mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
Merge pull request #14175 from strapi/fix/test-prop-types
chore: Fix some test errors
This commit is contained in:
commit
bd14f60980
@ -31,7 +31,7 @@ exports[`DynamicTabe / Cellcontent / RelationSingle renders and matches the snap
|
||||
<span
|
||||
class="c0 c1"
|
||||
>
|
||||
|
||||
1
|
||||
</span>
|
||||
<div
|
||||
class="c2"
|
||||
|
@ -15,7 +15,7 @@ const DEFAULT_PROPS_FIXTURE = {
|
||||
},
|
||||
},
|
||||
value: {
|
||||
count: 1,
|
||||
name: 1,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,7 @@ describe('<AddComponentButton />', () => {
|
||||
<IntlProvider locale="en" messages={{}} defaultLocale="en">
|
||||
<AddComponentButton
|
||||
label="test"
|
||||
isDisabled={false}
|
||||
isOpen={false}
|
||||
name="name"
|
||||
onClick={jest.fn()}
|
||||
@ -38,6 +39,7 @@ describe('<AddComponentButton />', () => {
|
||||
<AddComponentButton
|
||||
label="test"
|
||||
isOpen
|
||||
isDisabled={false}
|
||||
name="name"
|
||||
onClick={jest.fn()}
|
||||
hasError={false}
|
||||
@ -58,6 +60,7 @@ describe('<AddComponentButton />', () => {
|
||||
<AddComponentButton
|
||||
label=""
|
||||
isOpen={false}
|
||||
isDisabled={false}
|
||||
name="name"
|
||||
onClick={jest.fn()}
|
||||
hasError={false}
|
||||
|
@ -8,7 +8,7 @@ import UseCasePage from '../index';
|
||||
|
||||
jest.mock('../../../components/LocalesProvider/useLocalesProvider', () => () => ({
|
||||
changeLocale() {},
|
||||
localeNames: ['en'],
|
||||
localeNames: { en: 'English' },
|
||||
messages: ['test'],
|
||||
}));
|
||||
jest.mock('../../../hooks/useConfigurations', () => () => ({
|
||||
@ -734,11 +734,14 @@ describe('Admin | UseCasePage', () => {
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="c2 c3"
|
||||
label="English"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="c4 c5"
|
||||
/>
|
||||
>
|
||||
English
|
||||
</span>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="c6 c7"
|
||||
|
@ -248,6 +248,7 @@ exports[`Media Library | Breadcrumbs should render and match snapshot 1`] = `
|
||||
|
||||
<div>
|
||||
<nav
|
||||
aria-label="Navigation"
|
||||
class="c0 "
|
||||
>
|
||||
<ol
|
||||
|
@ -40,7 +40,7 @@ const setup = (props) =>
|
||||
<MemoryRouter>
|
||||
<IntlProvider locale="en" messages={{}}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<Breadcrumbs breadcrumbs={defaultBreadcrumbs} as="nav" {...props} />
|
||||
<Breadcrumbs breadcrumbs={defaultBreadcrumbs} label="Navigation" as="nav" {...props} />
|
||||
</ThemeProvider>
|
||||
</IntlProvider>
|
||||
</MemoryRouter>
|
||||
|
@ -77,7 +77,13 @@ export const AssetDefinition = PropTypes.shape({
|
||||
|
||||
export const CrumbDefinition = PropTypes.shape({
|
||||
id: PropTypes.number,
|
||||
label: PropTypes.string.isRequired,
|
||||
label: PropTypes.oneOfType([
|
||||
PropTypes.string,
|
||||
PropTypes.shape({
|
||||
id: PropTypes.string.isRequired,
|
||||
defaultMessage: PropTypes.string.isRequired,
|
||||
}),
|
||||
]).isRequired,
|
||||
href: PropTypes.string,
|
||||
});
|
||||
|
||||
|
@ -10,7 +10,7 @@ export const useFolder = jest.fn().mockReturnValue({
|
||||
count: 1,
|
||||
},
|
||||
path: '/1',
|
||||
pathId: '1',
|
||||
pathId: 1,
|
||||
updatedAt: '',
|
||||
parent: {
|
||||
id: 2,
|
||||
@ -23,7 +23,7 @@ export const useFolder = jest.fn().mockReturnValue({
|
||||
count: 1,
|
||||
},
|
||||
path: '/1',
|
||||
pathId: '1',
|
||||
pathId: 1,
|
||||
updatedAt: '',
|
||||
},
|
||||
},
|
||||
|
@ -24,7 +24,7 @@ const FIXTURE_FOLDER = {
|
||||
count: 1,
|
||||
},
|
||||
path: '/1',
|
||||
pathId: '1',
|
||||
pathId: 1,
|
||||
updatedAt: '',
|
||||
parent: {
|
||||
id: 2,
|
||||
@ -37,7 +37,7 @@ const FIXTURE_FOLDER = {
|
||||
count: 1,
|
||||
},
|
||||
path: '/1',
|
||||
pathId: '1',
|
||||
pathId: 1,
|
||||
updatedAt: '',
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user