From c490835f9bfd66d0f159a145128f195561547bd0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 7 Aug 2022 12:59:04 +0200 Subject: [PATCH] Ensured menu is displayed before asserting in DateRangeSelector test --- test/utils/dates/DateRangeSelector.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/utils/dates/DateRangeSelector.test.tsx b/test/utils/dates/DateRangeSelector.test.tsx index 868c03c0..c776cec9 100644 --- a/test/utils/dates/DateRangeSelector.test.tsx +++ b/test/utils/dates/DateRangeSelector.test.tsx @@ -1,4 +1,4 @@ -import { screen } from '@testing-library/react'; +import { screen, waitFor } from '@testing-library/react'; import { Mock } from 'ts-mockery'; import { DateRangeSelector, DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector'; import { DateInterval } from '../../../src/utils/dates/types'; @@ -16,6 +16,7 @@ describe('', () => { ); await result.user.click(screen.getByRole('button')); + await waitFor(() => screen.getByRole('menu')); return result; };