mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
Fix tests
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
77dbbfffd4
commit
36a0ab2b24
@ -44,6 +44,10 @@ const ModalCreate = ({ onClose, isOpened }) => {
|
||||
|
||||
const defaultOption = options[0];
|
||||
|
||||
if (!defaultOption) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpened} onToggle={onClose} withoverflow="true" onClosed={handleClosed}>
|
||||
<Formik
|
||||
|
||||
@ -24,7 +24,6 @@ const ModalEdit = ({ localeToEdit, onClose, locales }) => {
|
||||
|
||||
return editLocale(id, { name, isDefault })
|
||||
.then(() => {
|
||||
console.log('ici');
|
||||
setShouldUpdateMenu(true);
|
||||
})
|
||||
.then(onClose);
|
||||
|
||||
@ -65,6 +65,8 @@ jest.mock('strapi-helper-plugin', () => ({
|
||||
useUserPermissions: jest.fn(),
|
||||
request: jest.fn(),
|
||||
selectStyles: () => ({ control: () => ({}), indicatorsContainer: () => ({}) }),
|
||||
useGlobalContext: () => ({ updateMenu: jest.fn() }),
|
||||
useUser: () => ({ fetchUserPermissions: jest.fn() }),
|
||||
}));
|
||||
|
||||
jest.mock('../../../utils', () => ({
|
||||
|
||||
@ -14,7 +14,7 @@ const fetchDefaultLocalesList = async () => {
|
||||
message: { id: 'notification.error' },
|
||||
});
|
||||
|
||||
return e;
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user