Skip to content

Commit

Permalink
Don't bother wrapping sendKeysElem in a timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
svanherk committed Jun 30, 2023
1 parent c09d239 commit 3dc5c0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/button/test/button-move.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe('d2l-button-move', () => {
describe('events', () => {

[
{ name: 'up icon clicked', action: el => el.shadowRoot.querySelector('.up-layer').click(), expectedAction: moveActions.up },
{ name: 'down icon clicked', action: el => el.shadowRoot.querySelector('.down-layer').click(), expectedAction: moveActions.down },
{ name: 'up icon clicked', action: el => setTimeout(() => el.shadowRoot.querySelector('.up-layer').click()), expectedAction: moveActions.up },
{ name: 'down icon clicked', action: el => setTimeout(() => el.shadowRoot.querySelector('.down-layer').click()), expectedAction: moveActions.down },
{ name: 'up key pressed', action: el => sendKeysElem(el.shadowRoot.querySelector('button'), 'press', 'ArrowUp'), expectedAction: moveActions.up },
{ name: 'down key pressed', action: el => sendKeysElem(el.shadowRoot.querySelector('button'), 'press', 'ArrowDown'), expectedAction: moveActions.down },
{ name: 'left key pressed', action: el => sendKeysElem(el.shadowRoot.querySelector('button'), 'press', 'ArrowLeft'), expectedAction: moveActions.left },
Expand All @@ -28,7 +28,7 @@ describe('d2l-button-move', () => {
].forEach(info => {
it(`dispatches d2l-button-move-action event when ${info.name}`, async() => {
const el = await fixture(html`<d2l-button-move text="Reorder"></d2l-button-move>`);
setTimeout(() => info.action(el));
info.action(el);
const e = await oneEvent(el, 'd2l-button-move-action');
expect(e.detail.action).to.equal(info.expectedAction);
});
Expand Down

0 comments on commit 3dc5c0f

Please sign in to comment.