diff options
author | Viktor Vorona <viktor.vorona@sonarsource.com> | 2024-02-20 12:33:24 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-02-20 20:02:38 +0000 |
commit | 9dad49eb7171c374a67b5352cb5bd4db79589e6e (patch) | |
tree | a3b5cf0e634be49051c98f9231a1bae6673c3288 /server/sonar-web/design-system | |
parent | 2bfa1d52031005a5ead4d92a9451c260d3878cc0 (diff) | |
download | sonarqube-9dad49eb7171c374a67b5352cb5bd4db79589e6e.tar.gz sonarqube-9dad49eb7171c374a67b5352cb5bd4db79589e6e.zip |
SONAR-21692 Remove act() that are not needed
Diffstat (limited to 'server/sonar-web/design-system')
2 files changed, 4 insertions, 8 deletions
diff --git a/server/sonar-web/design-system/src/components/input/__tests__/DateRangePicker-test.tsx b/server/sonar-web/design-system/src/components/input/__tests__/DateRangePicker-test.tsx index 65d0625d6cf..d552d33d231 100644 --- a/server/sonar-web/design-system/src/components/input/__tests__/DateRangePicker-test.tsx +++ b/server/sonar-web/design-system/src/components/input/__tests__/DateRangePicker-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { act, screen } from '@testing-library/react'; +import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { formatISO, parseISO } from 'date-fns'; import { byRole } from '../../../../../src/main/js/helpers/testSelector'; @@ -58,9 +58,7 @@ it('behaves correctly', async () => { onChange.mockClear(); - act(() => { - jest.runAllTimers(); - }); + jest.runAllTimers(); const previousButton = nav.byRole('button', { name: 'previous_month_x' }); const nextButton = nav.byRole('button', { name: 'next_month_x' }); diff --git a/server/sonar-web/design-system/src/components/input/__tests__/SearchSelectDropdown-test.tsx b/server/sonar-web/design-system/src/components/input/__tests__/SearchSelectDropdown-test.tsx index 9f24bd11675..0e0c83c33bc 100644 --- a/server/sonar-web/design-system/src/components/input/__tests__/SearchSelectDropdown-test.tsx +++ b/server/sonar-web/design-system/src/components/input/__tests__/SearchSelectDropdown-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { act, screen } from '@testing-library/react'; +import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { renderWithContext } from '../../../helpers/testUtils'; import { FCProps } from '../../../types/misc'; @@ -65,9 +65,7 @@ it('should handle key navigation', async () => { expect(screen.queryByText('different')).not.toBeInTheDocument(); await user.keyboard('{Escape}'); expect(await screen.findByText('different')).toBeInTheDocument(); - await act(async () => { - await user.keyboard('{Escape}'); - }); + await user.keyboard('{Escape}'); expect(screen.queryByText('different')).not.toBeInTheDocument(); await user.tab({ shift: true }); await user.keyboard('{ArrowDown}'); |