test: Fix act errors in SamplesPane test (#21406)

This commit is contained in:
Lyndsi Kay Williams 2022-09-09 06:33:14 -05:00 committed by GitHub
parent 295de2d098
commit bd1abd3b6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -22,9 +22,9 @@ import userEvent from '@testing-library/user-event';
import {
render,
waitForElementToBeRemoved,
waitFor,
} from 'spec/helpers/testing-library';
import { exploreActions } from 'src/explore/actions/exploreActions';
import { promiseTimeout } from '@superset-ui/core';
import { SamplesPane } from '../components';
import { createSamplesPaneProps } from './fixture';
@ -72,9 +72,9 @@ describe('SamplesPane', () => {
expect(
await findByText('No samples were returned for this dataset'),
).toBeVisible();
await promiseTimeout(() => {
await waitFor(() => {
expect(setForceQuery).toHaveBeenCalledTimes(0);
}, 10);
});
});
test('error response', async () => {
@ -100,9 +100,9 @@ describe('SamplesPane', () => {
},
);
await promiseTimeout(() => {
await waitFor(() => {
expect(setForceQuery).toHaveBeenCalledTimes(1);
}, 10);
});
expect(queryByText('2 rows')).toBeVisible();
expect(queryByText('Action')).toBeVisible();
expect(queryByText('Horror')).toBeVisible();