2021-05-24 17:26:56 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// eslint-disable-next-line node/no-extraneous-require
|
|
|
|
const { combineReducers, createStore } = require('redux');
|
|
|
|
|
|
|
|
const reducers = {
|
2021-05-28 08:49:47 +02:00
|
|
|
// app: jest.fn(() => ({ isLoading: true, uuid: false })),
|
2021-05-24 17:26:56 +02:00
|
|
|
language: jest.fn(() => ({ locale: 'en' })),
|
|
|
|
menu: jest.fn(() => ({
|
|
|
|
collectionTypesSectionLinks: [],
|
|
|
|
generalSectionLinks: [
|
|
|
|
{
|
|
|
|
icon: 'list',
|
|
|
|
label: 'app.components.LeftMenuLinkContainer.listPlugins',
|
|
|
|
destination: '/list-plugins',
|
|
|
|
isDisplayed: false,
|
|
|
|
permissions: [
|
|
|
|
{ action: 'admin::marketplace.read', subject: null },
|
|
|
|
{ action: 'admin::marketplace.plugins.install', subject: null },
|
|
|
|
{ action: 'admin::marketplace.plugins.uninstall', subject: null },
|
|
|
|
],
|
|
|
|
notificationsCount: 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'shopping-basket',
|
|
|
|
label: 'app.components.LeftMenuLinkContainer.installNewPlugin',
|
|
|
|
destination: '/marketplace',
|
|
|
|
isDisplayed: false,
|
|
|
|
permissions: [
|
|
|
|
{ action: 'admin::marketplace.read', subject: null },
|
|
|
|
{ action: 'admin::marketplace.plugins.install', subject: null },
|
|
|
|
{ action: 'admin::marketplace.plugins.uninstall', subject: null },
|
|
|
|
],
|
|
|
|
notificationsCount: 0,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'cog',
|
|
|
|
label: 'app.components.LeftMenuLinkContainer.settings',
|
|
|
|
isDisplayed: false,
|
|
|
|
destination: '/settings',
|
|
|
|
// Permissions of this link are retrieved in the init phase
|
|
|
|
// using the settings menu
|
|
|
|
permissions: [],
|
|
|
|
notificationsCount: 0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
singleTypesSectionLinks: [],
|
|
|
|
pluginsSectionLinks: [],
|
|
|
|
isLoading: true,
|
|
|
|
})),
|
|
|
|
rbacProvider: jest.fn(() => ({ allPermissions: null, collectionTypesRelatedPermissions: {} })),
|
|
|
|
};
|
|
|
|
|
|
|
|
const store = createStore(combineReducers(reducers)).getState();
|
|
|
|
|
|
|
|
module.exports = store;
|