Skip to content

Commit

Permalink
Fix randomly failing UT
Browse files Browse the repository at this point in the history
  • Loading branch information
jmainguytalend committed Nov 9, 2023
1 parent f1bd462 commit e80bc61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/forms/src/UIForm/fields/File/File.component.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { screen, render } from '@testing-library/react';
import { screen, render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import File, { FileWidget, base64Decode } from './File.component';

Expand Down Expand Up @@ -100,7 +100,9 @@ describe('File field', () => {
// when
const fileInput = document.querySelector('input[type="file"]');
await userEvent.upload(fileInput, blob);
expect(props.onChange).toHaveBeenCalledWith(expect.anything(), { schema, value });
await waitFor(() =>
expect(props.onChange).toHaveBeenCalledWith(expect.anything(), { schema, value }),
);
});

it('should trigger pre-signed url related onChange when user select file', async () => {
Expand Down

0 comments on commit e80bc61

Please sign in to comment.