insomnia/app/reducers/__tests__/requestGroups.test.js

31 lines
567 B
JavaScript
Raw Normal View History

2016-04-04 07:15:30 +00:00
jest.unmock('../requestGroups');
2016-04-04 01:05:34 +00:00
jest.unmock('../../constants/actionTypes');
2016-04-04 07:15:30 +00:00
import reducer from '../requestGroups';
2016-04-04 01:05:34 +00:00
2016-04-04 07:15:30 +00:00
describe('RequestGroups Reducer', () => {
2016-04-04 01:05:34 +00:00
var initialState;
2016-04-04 07:15:30 +00:00
var requestGroup;
2016-04-04 01:05:34 +00:00
beforeEach(() => {
initialState = {
2016-04-06 16:50:11 +00:00
all: []
2016-04-04 01:05:34 +00:00
};
2016-04-04 07:15:30 +00:00
requestGroup = {
id: 'rg_1234567890',
2016-04-04 01:05:34 +00:00
created: Date.now(),
modified: Date.now(),
2016-04-04 07:15:30 +00:00
name: 'My Group',
environment: {},
children: []
2016-04-04 01:05:34 +00:00
};
});
it('returns initial state', () => {
expect(
reducer(undefined, {})
).toEqual(initialState);
});
});