Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
WIP: Update activeElement equality check in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
acdvorak committed Feb 11, 2019
1 parent d6d7132 commit b6f32cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/unit/mdc-drawer/mdc-drawer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,13 @@ test('adapter#focusActiveNavigationItem focuses on active navigation item', () =

test('adapter#focusActiveNavigationItem does nothing if no active navigation item exists', () => {
const {component, root} = setupTest();
const prevActiveElement = document.activeElement;
document.body.appendChild(root);
const activatedNavigationItemEl = root.querySelector(`.${MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS}`);
activatedNavigationItemEl.classList.remove(MDCListFoundation.cssClasses.LIST_ITEM_ACTIVATED_CLASS);
component.getDefaultFoundation().adapter_.focusActiveNavigationItem();

assert.notEqual(document.activeElement, activatedNavigationItemEl);
assert.equal(document.activeElement, prevActiveElement);
document.body.removeChild(root);
});

Expand Down

0 comments on commit b6f32cd

Please sign in to comment.