From 6798bc9fa6fd8537ce204d3f0e00a678cad8ac5b Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 1 Nov 2024 18:47:04 +0100 Subject: [PATCH] Remove waitFor in tests --- .../EditManualOptionsWithEditor.test.tsx | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditManualOptionsWithEditor/EditManualOptionsWithEditor.test.tsx b/frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditManualOptionsWithEditor/EditManualOptionsWithEditor.test.tsx index addfac5c7be..85046a21b8a 100644 --- a/frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditManualOptionsWithEditor/EditManualOptionsWithEditor.test.tsx +++ b/frontend/packages/ux-editor/src/components/config/editModal/EditOptions/OptionTabs/EditManualOptionsWithEditor/EditManualOptionsWithEditor.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { screen, waitFor } from '@testing-library/react'; +import { screen } from '@testing-library/react'; import { EditManualOptionsWithEditor } from './EditManualOptionsWithEditor'; import { renderWithProviders } from '../../../../../../testing/mocks'; import { textMock } from '@studio/testing/mocks/i18nMock'; @@ -141,14 +141,12 @@ describe('EditManualOptionsWithEditor', () => { await user.click(addNewButton); await user.click(addNewButton); - await waitFor(() => { - expect(mockHandleComponentChange).toHaveBeenCalledWith({ - ...mockComponent, - options: [ - { label: '', value: '' }, - { label: '', value: '' }, - ], - }); + expect(mockHandleComponentChange).toHaveBeenCalledWith({ + ...mockComponent, + options: [ + { label: '', value: '' }, + { label: '', value: '' }, + ], }); }); @@ -174,11 +172,9 @@ describe('EditManualOptionsWithEditor', () => { await user.click(addNewButton); - await waitFor(() => { - expect(mockHandleComponentChange).toHaveBeenCalledWith({ - ...mockComponent, // does not contain optionsId - options: [{ label: '', value: '' }], - }); + expect(mockHandleComponentChange).toHaveBeenCalledWith({ + ...mockComponent, // does not contain optionsId + options: [{ label: '', value: '' }], }); }); });