@@ -226,9 +226,10 @@ test('renders a value filter type', () => {
226226test ( 'renders a numerical range filter type' , async ( ) => {
227227 defaultRender ( ) ;
228228
229- userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
229+ await userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
230230
231- await waitFor ( ( ) => userEvent . click ( screen . getByText ( NUMERICAL_RANGE_REGEX ) ) ) ;
231+ const numericalRangeOption = await waitFor ( ( ) => screen . getByText ( NUMERICAL_RANGE_REGEX ) ) ;
232+ await userEvent . click ( numericalRangeOption ) ;
232233
233234 expect ( screen . getByText ( FILTER_TYPE_REGEX ) ) . toBeInTheDocument ( ) ;
234235 expect ( screen . getByText ( FILTER_NAME_REGEX ) ) . toBeInTheDocument ( ) ;
@@ -250,9 +251,10 @@ test('renders a numerical range filter type', async () => {
250251test ( 'renders a time range filter type' , async ( ) => {
251252 defaultRender ( ) ;
252253
253- userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
254+ await userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
254255
255- await waitFor ( ( ) => userEvent . click ( screen . getByText ( TIME_RANGE_REGEX ) ) ) ;
256+ const timeRangeOption = await waitFor ( ( ) => screen . getByText ( TIME_RANGE_REGEX ) ) ;
257+ await userEvent . click ( timeRangeOption ) ;
256258
257259 expect ( screen . getByText ( FILTER_TYPE_REGEX ) ) . toBeInTheDocument ( ) ;
258260 expect ( screen . getByText ( FILTER_NAME_REGEX ) ) . toBeInTheDocument ( ) ;
@@ -265,9 +267,10 @@ test('renders a time range filter type', async () => {
265267test ( 'renders a time column filter type' , async ( ) => {
266268 defaultRender ( ) ;
267269
268- userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
270+ await userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
269271
270- await waitFor ( ( ) => userEvent . click ( screen . getByText ( TIME_COLUMN_REGEX ) ) ) ;
272+ const timeColumnOption = await waitFor ( ( ) => screen . getByText ( TIME_COLUMN_REGEX ) ) ;
273+ await userEvent . click ( timeColumnOption ) ;
271274
272275 expect ( screen . getByText ( FILTER_TYPE_REGEX ) ) . toBeInTheDocument ( ) ;
273276 expect ( screen . getByText ( FILTER_NAME_REGEX ) ) . toBeInTheDocument ( ) ;
@@ -280,9 +283,10 @@ test('renders a time column filter type', async () => {
280283test ( 'renders a time grain filter type' , async ( ) => {
281284 defaultRender ( ) ;
282285
283- userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
286+ await userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
284287
285- await waitFor ( ( ) => userEvent . click ( screen . getByText ( TIME_GRAIN_REGEX ) ) ) ;
288+ const timeGrainOption = await waitFor ( ( ) => screen . getByText ( TIME_GRAIN_REGEX ) ) ;
289+ await userEvent . click ( timeGrainOption ) ;
286290
287291 expect ( screen . getByText ( FILTER_TYPE_REGEX ) ) . toBeInTheDocument ( ) ;
288292 expect ( screen . getByText ( FILTER_NAME_REGEX ) ) . toBeInTheDocument ( ) ;
@@ -295,7 +299,7 @@ test('renders a time grain filter type', async () => {
295299test ( 'render time filter types as disabled if there are no temporal columns in the dataset' , async ( ) => {
296300 defaultRender ( noTemporalColumnsState ( ) ) ;
297301
298- userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
302+ await userEvent . click ( screen . getByText ( VALUE_REGEX ) ) ;
299303
300304 const timeRange = await screen . findByText ( TIME_RANGE_REGEX ) ;
301305 const timeGrain = await screen . findByText ( TIME_GRAIN_REGEX ) ;
@@ -309,7 +313,7 @@ test('render time filter types as disabled if there are no temporal columns in t
309313
310314test ( 'validates the name' , async ( ) => {
311315 defaultRender ( ) ;
312- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
316+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
313317 await waitFor (
314318 async ( ) => {
315319 expect ( await screen . findByText ( NAME_REQUIRED_REGEX ) ) . toBeInTheDocument ( ) ;
@@ -320,16 +324,16 @@ test('validates the name', async () => {
320324
321325test ( 'validates the column' , async ( ) => {
322326 defaultRender ( ) ;
323- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
327+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
324328 expect ( await screen . findByText ( COLUMN_REQUIRED_REGEX ) ) . toBeInTheDocument ( ) ;
325329} ) ;
326330
327331// eslint-disable-next-line jest/no-disabled-tests
328332test . skip ( 'validates the default value' , async ( ) => {
329333 defaultRender ( noTemporalColumnsState ( ) ) ;
330334 expect ( await screen . findByText ( 'birth_names' ) ) . toBeInTheDocument ( ) ;
331- userEvent . type ( screen . getByRole ( 'combobox' ) , `Column A{Enter}` ) ;
332- userEvent . click ( getCheckbox ( DEFAULT_VALUE_REGEX ) ) ;
335+ await userEvent . type ( screen . getByRole ( 'combobox' ) , `Column A{Enter}` ) ;
336+ await userEvent . click ( getCheckbox ( DEFAULT_VALUE_REGEX ) ) ;
333337 await waitFor ( ( ) => {
334338 expect (
335339 screen . queryByText ( FILL_REQUIRED_FIELDS_REGEX ) ,
@@ -345,8 +349,8 @@ test('validates the pre-filter value', async () => {
345349 try {
346350 defaultRender ( ) ;
347351
348- userEvent . click ( screen . getByText ( FILTER_SETTINGS_REGEX ) ) ;
349- userEvent . click ( getCheckbox ( PRE_FILTER_REGEX ) ) ;
352+ await userEvent . click ( screen . getByText ( FILTER_SETTINGS_REGEX ) ) ;
353+ await userEvent . click ( getCheckbox ( PRE_FILTER_REGEX ) ) ;
350354
351355 jest . runAllTimers ( ) ;
352356 } finally {
@@ -368,13 +372,13 @@ test('validates the pre-filter value', async () => {
368372// eslint-disable-next-line jest/no-disabled-tests
369373test . skip ( "doesn't render time range pre-filter if there are no temporal columns in datasource" , async ( ) => {
370374 defaultRender ( noTemporalColumnsState ( ) ) ;
371- userEvent . click ( screen . getByText ( DATASET_REGEX ) ) ;
372- await waitFor ( ( ) => {
375+ await userEvent . click ( screen . getByText ( DATASET_REGEX ) ) ;
376+ await waitFor ( async ( ) => {
373377 expect ( screen . queryByLabelText ( 'Loading' ) ) . not . toBeInTheDocument ( ) ;
374- userEvent . click ( screen . getByText ( 'birth_names' ) ) ;
378+ await userEvent . click ( screen . getByText ( 'birth_names' ) ) ;
375379 } ) ;
376- userEvent . click ( screen . getByText ( FILTER_SETTINGS_REGEX ) ) ;
377- userEvent . click ( getCheckbox ( PRE_FILTER_REGEX ) ) ;
380+ await userEvent . click ( screen . getByText ( FILTER_SETTINGS_REGEX ) ) ;
381+ await userEvent . click ( getCheckbox ( PRE_FILTER_REGEX ) ) ;
378382 await waitFor ( ( ) =>
379383 expect (
380384 screen . queryByText ( TIME_RANGE_PREFILTER_REGEX ) ,
@@ -439,9 +443,9 @@ test('deletes a filter', async () => {
439443 const removeButtons = screen . getAllByRole ( 'button' , {
440444 name : 'delete' ,
441445 } ) ;
442- userEvent . click ( removeButtons [ 2 ] ) ;
446+ await userEvent . click ( removeButtons [ 2 ] ) ;
443447
444- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
448+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
445449
446450 await waitFor ( ( ) =>
447451 expect ( onSave ) . toHaveBeenCalledWith (
@@ -476,8 +480,8 @@ test('deletes a filter including dependencies', async () => {
476480 const removeButtons = screen . getAllByRole ( 'button' , {
477481 name : 'delete' ,
478482 } ) ;
479- userEvent . click ( removeButtons [ 1 ] ) ;
480- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
483+ await userEvent . click ( removeButtons [ 1 ] ) ;
484+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
481485 await waitFor ( ( ) =>
482486 expect ( onSave ) . toHaveBeenCalledWith (
483487 expect . objectContaining ( {
@@ -525,7 +529,7 @@ test('switches the order between two filters', async () => {
525529
526530 fireEvent . dragEnd ( draggableFilters [ 0 ] ) ;
527531
528- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
532+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
529533
530534 await waitFor ( ( ) =>
531535 expect ( onSave ) . toHaveBeenCalledWith (
@@ -568,14 +572,14 @@ test('rearranges three filters and deletes one of them', async () => {
568572 const deleteButtons = screen . getAllByRole ( 'button' , {
569573 name : 'delete' ,
570574 } ) ;
571- userEvent . click ( deleteButtons [ 1 ] ) ;
575+ await userEvent . click ( deleteButtons [ 1 ] ) ;
572576
573577 fireEvent . dragStart ( draggableFilters [ 0 ] ) ;
574578 fireEvent . dragOver ( draggableFilters [ 2 ] ) ;
575579 fireEvent . drop ( draggableFilters [ 2 ] ) ;
576580 fireEvent . dragEnd ( draggableFilters [ 0 ] ) ;
577581
578- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
582+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
579583
580584 await waitFor ( ( ) =>
581585 expect ( onSave ) . toHaveBeenCalledWith (
@@ -619,12 +623,12 @@ test('modifies the name of a filter', async () => {
619623 name : FILTER_NAME_REGEX ,
620624 } ) ;
621625
622- userEvent . clear ( filterNameInput ) ;
623- userEvent . type ( filterNameInput , 'New Filter Name' ) ;
626+ await userEvent . clear ( filterNameInput ) ;
627+ await userEvent . type ( filterNameInput , 'New Filter Name' ) ;
624628
625629 jest . runAllTimers ( ) ;
626630
627- userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
631+ await userEvent . click ( screen . getByRole ( 'button' , { name : SAVE_REGEX } ) ) ;
628632
629633 await waitFor ( ( ) =>
630634 expect ( onSave ) . toHaveBeenCalledWith (
0 commit comments