Merge pull request #14175 from strapi/fix/test-prop-types

chore: Fix some test errors
This commit is contained in:
Gustav Hansen 2022-08-23 15:44:22 +02:00 committed by GitHub
commit bd14f60980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 10 deletions

View File

@ -31,7 +31,7 @@ exports[`DynamicTabe / Cellcontent / RelationSingle renders and matches the snap
<span
class="c0 c1"
>
1
</span>
<div
class="c2"

View File

@ -15,7 +15,7 @@ const DEFAULT_PROPS_FIXTURE = {
},
},
value: {
count: 1,
name: 1,
},
};

View File

@ -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}

View File

@ -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"

View File

@ -248,6 +248,7 @@ exports[`Media Library | Breadcrumbs should render and match snapshot 1`] = `
<div>
<nav
aria-label="Navigation"
class="c0 "
>
<ol

View File

@ -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>

View File

@ -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,
});

View File

@ -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: '',
},
},

View File

@ -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: '',
},
};