mirror of
https://github.com/strapi/strapi.git
synced 2025-10-27 16:10:08 +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 = {};
|
||||
|
||||
const {{camelCase name}}Reducer = (state = initialState, action) =>
|
||||
const {{ camelCase name }}Reducer = (state = initialState, action) =>
|
||||
// eslint-disable-next-line consistent-return
|
||||
produce(state, draftState => {
|
||||
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~}}
|
||||
${pluginId}
|
||||
{{~/if~}}
|
||||
_{{camelCase name}}`] || initialState;
|
||||
_{{ camelCase name }}`] || initialState;
|
||||
|
||||
@ -25,7 +25,7 @@ import {{ name }} from '../index';
|
||||
ui,
|
||||
{
|
||||
preloadedState = initialState,
|
||||
store = createStore(rootReducer, { '{{ plugin }}_{{camelCase name}}': preloadedState }),
|
||||
store = createStore(rootReducer, { '{{ plugin }}_{{ camelCase name }}': preloadedState }),
|
||||
...renderOptions
|
||||
} = {},
|
||||
) => {
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
// 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 { someAction } from '../actions';
|
||||
|
||||
/* eslint-disable default-case, no-param-reassign */
|
||||
describe('{{camelCase name}}Reducer', () => {
|
||||
describe('{{ camelCase name }}Reducer', () => {
|
||||
let state;
|
||||
beforeEach(() => {
|
||||
state = {
|
||||
...fixtures.store.state,
|
||||
'{{ plugin }}_{{camelCase name}}': initialState,
|
||||
'{{ plugin }}_{{ camelCase name }}': initialState,
|
||||
};
|
||||
});
|
||||
|
||||
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;
|
||||
|
||||
beforeEach(() => {
|
||||
store = { ...fixtures.store.state, '{{ plugin }}_{{camelCase name}}': {} };
|
||||
store = { ...fixtures.store.state, '{{ plugin }}_{{ camelCase name }}': {} };
|
||||
});
|
||||
|
||||
it('expects to have unit tests specified', () => {
|
||||
const actual = select{{ name }}Domain(store);
|
||||
|
||||
// TBC
|
||||
expect(actual).toEqual(store['{{ plugin }}_{{camelCase name}}']);
|
||||
expect(actual).toEqual(store['{{ plugin }}_{{ camelCase name }}']);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user