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-06-24 08:22:44 +02:00
|
|
|
'content-manager_app': jest.fn(() => ({
|
|
|
|
components: [],
|
|
|
|
status: 'loading',
|
|
|
|
models: [],
|
|
|
|
collectionTypeLinks: [],
|
|
|
|
singleTypeLinks: [],
|
|
|
|
})),
|
|
|
|
'content-manager_listView': jest.fn(() => ({
|
|
|
|
data: [],
|
|
|
|
didDeleteData: false,
|
|
|
|
entriesToDelete: [],
|
|
|
|
isLoading: true,
|
|
|
|
showModalConfirmButtonLoading: false,
|
|
|
|
showWarningDelete: false,
|
|
|
|
showWarningDeleteAll: false,
|
|
|
|
contentType: {},
|
|
|
|
initialDisplayedHeaders: [],
|
|
|
|
displayedHeaders: [],
|
|
|
|
pagination: {
|
|
|
|
total: 0,
|
|
|
|
},
|
|
|
|
})),
|
|
|
|
'content-manager_rbacManager': jest.fn(() => ({ permissions: null })),
|
|
|
|
'content-manager_editViewLayoutManager': jest.fn(() => ({ currentLayout: null })),
|
|
|
|
'content-manager_editViewCrudReducer': jest.fn(() => ({
|
|
|
|
componentsDataStructure: {},
|
|
|
|
contentTypeDataStructure: {},
|
|
|
|
isLoading: true,
|
|
|
|
data: {},
|
|
|
|
status: 'resolved',
|
|
|
|
})),
|
2021-05-24 17:26:56 +02:00
|
|
|
rbacProvider: jest.fn(() => ({ allPermissions: null, collectionTypesRelatedPermissions: {} })),
|
|
|
|
};
|
|
|
|
|
2021-05-31 12:45:57 +02:00
|
|
|
const store = createStore(combineReducers(reducers));
|
2021-05-24 17:26:56 +02:00
|
|
|
|
2021-05-31 12:45:57 +02:00
|
|
|
module.exports = {
|
|
|
|
store,
|
|
|
|
state: store.getState(),
|
|
|
|
};
|