Skip to content

Commit

Permalink
remove retries (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart authored and bearfriend committed Jun 27, 2023
1 parent d1ebceb commit 409ebe8
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 409ebe8

Please sign in to comment.