mirror of
https://github.com/strapi/strapi.git
synced 2025-11-06 21:29:24 +00:00
Add tests
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
124fbfc3c7
commit
a9b4b10d88
@ -2,6 +2,44 @@ import { fromJS } from 'immutable';
|
|||||||
import reducer, { initialState } from '../reducer';
|
import reducer, { initialState } from '../reducer';
|
||||||
|
|
||||||
describe('Upload | containers | HomePage | reducer', () => {
|
describe('Upload | containers | HomePage | reducer', () => {
|
||||||
|
describe('GET_DATA', () => {
|
||||||
|
it('should set isLoading to true', () => {
|
||||||
|
const state = fromJS({
|
||||||
|
isLoading: false,
|
||||||
|
test: true,
|
||||||
|
});
|
||||||
|
const action = {
|
||||||
|
type: 'GET_DATA',
|
||||||
|
};
|
||||||
|
|
||||||
|
const expected = fromJS({
|
||||||
|
isLoading: true,
|
||||||
|
test: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(reducer(state, action)).toEqual(expected);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('GET_DATA_ERROR', () => {
|
||||||
|
it('should set isLoading to false', () => {
|
||||||
|
const state = fromJS({
|
||||||
|
isLoading: true,
|
||||||
|
test: true,
|
||||||
|
});
|
||||||
|
const action = {
|
||||||
|
type: 'GET_DATA_ERROR',
|
||||||
|
};
|
||||||
|
|
||||||
|
const expected = fromJS({
|
||||||
|
isLoading: false,
|
||||||
|
test: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(reducer(state, action)).toEqual(expected);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should update data with received data', () => {
|
it('should update data with received data', () => {
|
||||||
const state = initialState;
|
const state = initialState;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user