mirror of
https://github.com/strapi/strapi.git
synced 2026-01-07 12:45:45 +00:00
Fix: Improve test setup for workflow attributes
This commit is contained in:
parent
aa798f0ee7
commit
0ccfca6ea5
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||
import { act, render } from '@testing-library/react';
|
||||
import { render, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { FormikProvider, useFormik } from 'formik';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
@ -66,10 +66,6 @@ const setup = (props) => ({
|
||||
});
|
||||
|
||||
describe('Admin | Settings | Review Workflow | WorkflowAttributes', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should render values', async () => {
|
||||
const { getByRole, getByText, user } = setup();
|
||||
|
||||
@ -78,11 +74,11 @@ describe('Admin | Settings | Review Workflow | WorkflowAttributes', () => {
|
||||
expect(getByRole('textbox')).toHaveValue('workflow name');
|
||||
expect(getByText(/2 content types selected/i)).toBeInTheDocument();
|
||||
|
||||
await act(async () => {
|
||||
await user.click(contentTypesSelect);
|
||||
});
|
||||
await user.click(contentTypesSelect);
|
||||
|
||||
expect(getByRole('option', { name: /content type 1/i })).toBeInTheDocument();
|
||||
expect(getByRole('option', { name: /content type 2/i })).toBeInTheDocument();
|
||||
await waitFor(() => {
|
||||
expect(getByRole('option', { name: /content type 1/i })).toBeInTheDocument();
|
||||
expect(getByRole('option', { name: /content type 2/i })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user