Skip to content

Commit

Permalink
remove retries
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart committed Jun 21, 2023
1 parent 83db411 commit d5342bc
Show file tree
Hide file tree
Showing 3 changed files with 907 additions and 80 deletions.
18 changes: 2 additions & 16 deletions components/list/test/list-item-drag-handle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@ describe('ListItemDragHandle', () => {
it(`Dispatch drag handle action event for "${testCase.result}" when "${testCase.keyPress}" is pressed.`, async() => {
const actionArea = element.shadowRoot.querySelector('d2l-button-move').shadowRoot.querySelector('button');
setTimeout(() => dispatchKeyEvent(actionArea, testCase.keyPress));
let e = await oneEvent(element, 'd2l-list-item-drag-handle-action');
// Firefox will trigger loss of focus randomly, so retry
if (e.detail.action === dragActions.save) {
element.activateKeyboardMode();
await element.updateComplete;
setTimeout(() => dispatchKeyEvent(actionArea, testCase.keyPress));
e = await oneEvent(element, 'd2l-list-item-drag-handle-action');
}
const e = await oneEvent(element, 'd2l-list-item-drag-handle-action');
expect(e.detail.action).to.equal(testCase.result);
});
});
Expand All @@ -77,14 +70,7 @@ describe('ListItemDragHandle', () => {
it(`Dispatch drag handle action event for "${testCase.result}" when "${testCase.keyPress}" is pressed.`, async() => {
const actionArea = element.shadowRoot.querySelector('d2l-button-move');
setTimeout(() => dispatchKeyEvent(actionArea, testCase.keyPress, !!testCase.shift));
let e = await oneEvent(element, 'd2l-list-item-drag-handle-action');
// Firefox will trigger loss of focus randomly, so retry
if (e.detail.action !== testCase.result && e.detail.action === dragActions.save) {
element.activateKeyboardMode();
await element.updateComplete;
setTimeout(() => dispatchKeyEvent(actionArea, testCase.keyPress, !!testCase.shift));
e = await oneEvent(element, 'd2l-list-item-drag-handle-action');
}
const e = await oneEvent(element, 'd2l-list-item-drag-handle-action');
expect(e.detail.action).to.equal(testCase.result);
});
});
Expand Down
Loading

0 comments on commit d5342bc

Please sign in to comment.