Skip to content
Snippets Groups Projects
Commit 03b69824 authored by Jack Reed's avatar Jack Reed
Browse files

add tests for reducers

parent edf617b4
No related branches found
No related tags found
No related merge requests found
import reducer from '../../reducers/windows';
import ActionTypes from '../../action-types';
describe('windows reducer', () => {
it('should handle ADD_WINDOW', () => {
expect(reducer([], {
type: ActionTypes.ADD_WINDOW,
})).toEqual([
{},
]);
});
it('should handle REMOVE_WINDOW', () => {
expect(reducer([
{
id: 'abc123',
},
], {
type: ActionTypes.REMOVE_WINDOW,
windowId: 'abc123',
})).toEqual([]);
});
it('should handle NEXT_CANVAS', () => {
expect(reducer([
{
id: 'abc123',
canvasIndex: 1,
},
], {
type: ActionTypes.NEXT_CANVAS,
windowId: 'abc123',
})).toEqual([
{
id: 'abc123',
canvasIndex: 2,
},
]);
});
it('should handle PREVIOUS_CANVAS', () => {
expect(reducer([
{
id: 'abc123',
canvasIndex: 4,
},
], {
type: ActionTypes.PREVIOUS_CANVAS,
windowId: 'abc123',
})).toEqual([
{
id: 'abc123',
canvasIndex: 3,
},
]);
});
});
import reducer from '../../reducers/workspace';
import ActionTypes from '../../action-types';
describe('workspace reducer', () => {
it('should handle FOCUS_WINDOW', () => {
expect(reducer([], {
type: ActionTypes.FOCUS_WINDOW,
windowId: 'abc123',
})).toEqual({
focusedWindowId: 'abc123',
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment