Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Baby } from './entities/baby';
- var deepFreeze = require('deep-freeze');
- import { rootReducer, INITIAL_STATE } from './store';
- import * as types from './actions';
- describe('users reducer', () => {
- it('should return the initial state', () => {
- expect(rootReducer(INITIAL_STATE, {})).toEqual({
- babies: [],
- sitters: [],
- users: [],
- loggedInUser: null,
- subject: null
- });
- });
- it('Should add a new baby object to array of babies', () => {
- let state = {babies: []};
- deepFreeze(state);
- let newBaby = { firstname: 'Roland', postalCode: '2400', picture: 'no picture yet', age: 8, gender: 'MALE' };
- expect( rootReducer(state, {
- type: types.ADD_BABY,
- payload: newBaby
- })).toEqual({babies: [{ firstname: 'Roland', postalCode: '2400', picture: 'no picture yet', age: 8, gender: 'MALE' }]});
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement