Skip to content

Commit

Permalink
Add delays to fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospri committed Nov 2, 2021
1 parent 30f7773 commit 3509a59
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Config } from '../../config';
import FilePickerApp, { $imports } from '../FilePickerApp';
import { checkAccessibility } from '../../../test-util/accessibility';
import mockImportedComponents from '../../../test-util/mock-imported-components';
import { waitFor } from '../../../test-util/wait';
import { delay, waitFor } from '../../../test-util/wait';

function interact(wrapper, callback) {
act(callback);
Expand Down Expand Up @@ -145,6 +145,7 @@ describe('FilePickerApp', () => {
selectContent(wrapper, 'https://example.com');

await waitFor(() => fakeAPICall.called);
await delay(100);
wrapper.update();

assert.calledWith(fakeAPICall, {
Expand Down Expand Up @@ -180,6 +181,7 @@ describe('FilePickerApp', () => {
selectContent(wrapper, 'https://example.com');

await waitFor(() => fakeAPICall.called);
await delay(100);
wrapper.update();

const errDialog = wrapper.find('ErrorDialog');
Expand Down

0 comments on commit 3509a59

Please sign in to comment.