test: wait for rows to be displayed

This commit is contained in:
Sammy Teillet
2023-04-20 18:44:43 +02:00
parent b5affcce3f
commit 3a7b1077f8
4 changed files with 76 additions and 30 deletions

View File

@ -1,10 +1,12 @@
import { render } from '@testing-library/react';
import { render, waitFor } from '@testing-library/react';
import { PeopleDefault } from '../__stories__/People.stories';
it('Checks the People page render', () => {
it('Checks the People page render', async () => {
const { getByTestId } = render(<PeopleDefault />);
const title = getByTestId('top-bar-title');
expect(title).toHaveTextContent('People');
await waitFor(() => {
const personChip = getByTestId('row-id-0');
expect(personChip).toBeDefined();
});
});