Skip to content

Commit b2123fd

Browse files
committed
wrap user events in act
1 parent a77cad7 commit b2123fd

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/common/ExportSettingsModal/ExportSettingsModal.test.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import user from '@folio/jest-config-stripes/testing-library/user-event';
2-
import { render, screen } from '@folio/jest-config-stripes/testing-library/react';
2+
import {
3+
act,
4+
render,
5+
screen,
6+
} from '@folio/jest-config-stripes/testing-library/react';
37

48
import ExportSettingsModal from './ExportSettingsModal';
59

@@ -106,16 +110,22 @@ describe('ExportSettingsModal actions', () => {
106110
it('should export selected POL fields to CSV when export button clicked', async () => {
107111
renderExportSettingsModal();
108112

109-
await user.click(screen.getAllByRole('radio')[3]);
113+
await act(async () => {
114+
await user.click(screen.getAllByRole('radio')[3]);
115+
});
110116

111117
const selects = await screen.findAllByRole('combobox');
112118

113-
await user.click(selects[1]);
119+
await act(async () => {
120+
await user.click(selects[1]);
121+
});
114122

115123
const options = await screen.findAllByRole('option');
116124

117-
await user.click(options[0]);
118-
await user.click(screen.getByText('ui-orders.exportSettings.export'));
125+
await act(async () => {
126+
await user.click(options[0]);
127+
await user.click(screen.getByText('ui-orders.exportSettings.export'));
128+
});
119129

120130
expect(defaultProps.onExportCSV).toHaveBeenCalled();
121131
});

0 commit comments

Comments
 (0)