Fix tests

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-10-14 17:20:33 +02:00
parent 3ae6291467
commit 3d4a684076
3 changed files with 7 additions and 0 deletions

View File

@ -19,11 +19,13 @@ describe('<Admin />', () => {
props = { props = {
admin: { admin: {
appError: false, appError: false,
latestStrapiReleaseTag: '3',
}, },
disableGlobalOverlayBlocker: jest.fn(), disableGlobalOverlayBlocker: jest.fn(),
emitEvent: jest.fn(), emitEvent: jest.fn(),
enableGlobalOverlayBlocker: jest.fn(), enableGlobalOverlayBlocker: jest.fn(),
getInfosDataSucceeded: jest.fn(), getInfosDataSucceeded: jest.fn(),
getStrapiLatestReleaseSucceeded: jest.fn(),
getUserPermissions: jest.fn(), getUserPermissions: jest.fn(),
getUserPermissionsError: jest.fn(), getUserPermissionsError: jest.fn(),
getUserPermissionsSucceeded: jest.fn(), getUserPermissionsSucceeded: jest.fn(),
@ -43,6 +45,7 @@ describe('<Admin />', () => {
intl: { intl: {
formatMessage: jest.fn(), formatMessage: jest.fn(),
}, },
location: {}, location: {},
setAppError: jest.fn(), setAppError: jest.fn(),
showGlobalAppBlocker: jest.fn(), showGlobalAppBlocker: jest.fn(),

View File

@ -1,4 +1,5 @@
import produce from 'immer'; import produce from 'immer';
import packageJSON from '../../../../../package.json';
import { import {
setAppError, setAppError,
getUserPermissions, getUserPermissions,
@ -14,6 +15,7 @@ describe('adminReducer', () => {
state = { state = {
appError: false, appError: false,
isLoading: true, isLoading: true,
latestStrapiReleaseTag: `v${packageJSON.version}`,
userPermissions: [], userPermissions: [],
}; };
}); });

View File

@ -112,6 +112,7 @@ describe('ADMIN | LeftMenu | init', () => {
title: 'Settings.webhooks.title', title: 'Settings.webhooks.title',
to: '/settings/webhooks', to: '/settings/webhooks',
name: 'webhooks', name: 'webhooks',
permissions: [ permissions: [
{ action: 'admin::webhook.create', subject: null }, { action: 'admin::webhook.create', subject: null },
{ action: 'admin::webhook.read', subject: null }, { action: 'admin::webhook.read', subject: null },
@ -223,6 +224,7 @@ describe('ADMIN | LeftMenu | init', () => {
label: 'app.components.LeftMenuLinkContainer.settings', label: 'app.components.LeftMenuLinkContainer.settings',
isDisplayed: false, isDisplayed: false,
destination: SETTINGS_BASE_URL, destination: SETTINGS_BASE_URL,
notificationsCount: 0,
permissions: [ permissions: [
// webhooks // webhooks
{ action: 'admin::webhook.create', subject: null }, { action: 'admin::webhook.create', subject: null },