mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 06:35:47 +00:00
Fix tests and add the one in todo
This commit is contained in:
parent
ae7bff1546
commit
0bdf9f341f
@ -248,8 +248,6 @@ const IconButtonCustom = styled(IconButton)`
|
||||
}
|
||||
`;
|
||||
|
||||
// TODO: Delete once https://github.com/strapi/design-system/pull/858
|
||||
// is merged and released.
|
||||
const StyledBox = styled(Box)`
|
||||
> div:first-child {
|
||||
box-shadow: ${({ theme }) => theme.shadows.tableShadow};
|
||||
|
||||
@ -198,5 +198,12 @@ describe('DynamicComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it.todo('should handle errors in the fields');
|
||||
it('should handle errors in the fields', async () => {
|
||||
const { getByText } = render({
|
||||
index: 0,
|
||||
formErrors: { [`${defaultProps.name}.0`]: 'Error here' },
|
||||
});
|
||||
|
||||
expect(getByText('The component contains error(s)')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import { lightTheme, ThemeProvider } from '@strapi/design-system';
|
||||
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
|
||||
import { render as renderRTL } from '@testing-library/react';
|
||||
import { render as renderRTL, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
@ -299,9 +299,10 @@ describe('DynamicZone', () => {
|
||||
|
||||
const [draggedItem] = getAllByRole('button', { name: 'Drag' });
|
||||
|
||||
draggedItem.focus();
|
||||
|
||||
await user.keyboard('[Space]');
|
||||
await waitFor(() => {
|
||||
draggedItem.focus();
|
||||
user.keyboard('[Space]');
|
||||
});
|
||||
|
||||
expect(
|
||||
queryByText(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user