mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 23:29:33 +00:00
chore: Add forgotten spaces
This commit is contained in:
parent
14d215c602
commit
fc6b01d9cd
@ -9,7 +9,7 @@ import { DEFAULT_ACTION } from './constants';
|
|||||||
|
|
||||||
export const initialState = {};
|
export const initialState = {};
|
||||||
|
|
||||||
const {{camelCase name}}Reducer = (state = initialState, action) =>
|
const {{ camelCase name }}Reducer = (state = initialState, action) =>
|
||||||
// eslint-disable-next-line consistent-return
|
// eslint-disable-next-line consistent-return
|
||||||
produce(state, draftState => {
|
produce(state, draftState => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
@ -21,4 +21,4 @@ const {{camelCase name}}Reducer = (state = initialState, action) =>
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {{camelCase name}}Reducer;
|
export default {{ camelCase name }}Reducer;
|
||||||
|
|||||||
@ -14,4 +14,4 @@ export const select{{ name }}Domain = state => state[`
|
|||||||
{{~else~}}
|
{{~else~}}
|
||||||
${pluginId}
|
${pluginId}
|
||||||
{{~/if~}}
|
{{~/if~}}
|
||||||
_{{camelCase name}}`] || initialState;
|
_{{ camelCase name }}`] || initialState;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import {{ name }} from '../index';
|
|||||||
ui,
|
ui,
|
||||||
{
|
{
|
||||||
preloadedState = initialState,
|
preloadedState = initialState,
|
||||||
store = createStore(rootReducer, { '{{ plugin }}_{{camelCase name}}': preloadedState }),
|
store = createStore(rootReducer, { '{{ plugin }}_{{ camelCase name }}': preloadedState }),
|
||||||
...renderOptions
|
...renderOptions
|
||||||
} = {},
|
} = {},
|
||||||
) => {
|
) => {
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
// import produce from 'immer';
|
// import produce from 'immer';
|
||||||
import {{camelCase name}}Reducer, { initialState } from '../reducer';
|
import {{ camelCase name }}Reducer, { initialState } from '../reducer';
|
||||||
import { fixtures } from '../../../../../../../admin-test-utils';
|
import { fixtures } from '../../../../../../../admin-test-utils';
|
||||||
// import { someAction } from '../actions';
|
// import { someAction } from '../actions';
|
||||||
|
|
||||||
/* eslint-disable default-case, no-param-reassign */
|
/* eslint-disable default-case, no-param-reassign */
|
||||||
describe('{{camelCase name}}Reducer', () => {
|
describe('{{ camelCase name }}Reducer', () => {
|
||||||
let state;
|
let state;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
state = {
|
state = {
|
||||||
...fixtures.store.state,
|
...fixtures.store.state,
|
||||||
'{{ plugin }}_{{camelCase name}}': initialState,
|
'{{ plugin }}_{{ camelCase name }}': initialState,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns the initial state', () => {
|
it('returns the initial state', () => {
|
||||||
const expectedResult = state['{{ plugin }}_{{camelCase name}}'];
|
const expectedResult = state['{{ plugin }}_{{ camelCase name }}'];
|
||||||
|
|
||||||
expect({{camelCase name}}Reducer(undefined, {})).toEqual(expectedResult);
|
expect({{ camelCase name }}Reducer(undefined, {})).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,13 +5,13 @@ describe('select{{ name }}Domain', () => {
|
|||||||
let store;
|
let store;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
store = { ...fixtures.store.state, '{{ plugin }}_{{camelCase name}}': {} };
|
store = { ...fixtures.store.state, '{{ plugin }}_{{ camelCase name }}': {} };
|
||||||
});
|
});
|
||||||
|
|
||||||
it('expects to have unit tests specified', () => {
|
it('expects to have unit tests specified', () => {
|
||||||
const actual = select{{ name }}Domain(store);
|
const actual = select{{ name }}Domain(store);
|
||||||
|
|
||||||
// TBC
|
// TBC
|
||||||
expect(actual).toEqual(store['{{ plugin }}_{{camelCase name}}']);
|
expect(actual).toEqual(store['{{ plugin }}_{{ camelCase name }}']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user