Skip to content

Commit

Permalink
test: add focus handling test
Browse files Browse the repository at this point in the history
Add a test for #787
  • Loading branch information
Haprog committed Jun 28, 2019
1 parent 4ecee07 commit 6c5a8f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/toggling-dropdown.html
Expand Up @@ -363,6 +363,24 @@
expect(dropdown.$).to.be.ok;
});
});

describe('external focus (initially)', () => {
let input, blurSpy;

beforeEach(() => {
input = document.createElement('input');
combobox.insertAdjacentElement('beforebegin', input);
input.focus();
blurSpy = sinon.spy(input, 'blur');
});

if (touchDevice) {
it('should blur previously focused element when clicking on toggle button', () => {
clickToggleIcon();
expect(blurSpy).to.be.called;
});
}
});
});
</script>

Expand Down

0 comments on commit 6c5a8f9

Please sign in to comment.