mirror of
https://github.com/strapi/strapi.git
synced 2025-12-04 11:02:12 +00:00
fix: add another assertion
This commit is contained in:
parent
a463a07d2d
commit
b93670366e
@ -1,5 +1,5 @@
|
||||
import { unstable_useDocument } from '@strapi/content-manager/strapi-admin';
|
||||
import { render as renderRTL, waitFor, server, screen } from '@tests/utils';
|
||||
import { render as renderRTL, waitFor, server, screen, act } from '@tests/utils';
|
||||
import { rest } from 'msw';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
|
||||
@ -57,28 +57,12 @@ describe('AssigneeSelect', () => {
|
||||
});
|
||||
|
||||
it('renders a select with users, first user is selected', async () => {
|
||||
jest.mocked(unstable_useDocument).mockReturnValue({
|
||||
document: {
|
||||
documentId: '12345',
|
||||
id: 12345,
|
||||
['strapi_assignee']: {
|
||||
id: 1,
|
||||
firstname: 'John',
|
||||
lastname: 'Doe',
|
||||
},
|
||||
},
|
||||
isLoading: false,
|
||||
components: {},
|
||||
validate: jest.fn(),
|
||||
getInitialFormValues: jest.fn(),
|
||||
getTitle: jest.fn(),
|
||||
refetch: jest.fn(),
|
||||
});
|
||||
|
||||
render();
|
||||
|
||||
await waitFor(() => {
|
||||
const combobox = screen.getByRole('combobox');
|
||||
expect(combobox).toHaveAttribute('aria-disabled', 'false');
|
||||
// eslint-disable-next-line testing-library/no-wait-for-multiple-assertions
|
||||
expect(combobox).toHaveValue('John Doe');
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user