Skip to content
Snippets Groups Projects
Commit 397eb358 authored by Andrew Winget (Standard)'s avatar Andrew Winget (Standard)
Browse files

fix action tests

parent 42ae5aec
Branches
No related tags found
No related merge requests found
......@@ -120,12 +120,14 @@ describe('window actions', () => {
expect(mockDispatch).toHaveBeenCalledWith({
type: ActionTypes.TOGGLE_WINDOW_SIDE_BAR_PANEL, windowId, panelType: 'closed',
});
});
});
describe('setWindowSize', () => {
it('returns the appropriate action type', () => {
const id = 'abc123';
const expectedAction = {
type: ActionTypes.SET_WINDOW_THUMBNAIL_POSITION,
type: ActionTypes.SET_WINDOW_SIZE,
payload: {
windowId: id,
size: {
......@@ -136,11 +138,11 @@ describe('window actions', () => {
},
},
};
expect(actions.setWindowThumbnailPosition(id, {
expect(actions.setWindowSize(id, {
x: 20,
y: 20,
width: 200,
width: 200,
height: 200,
})).toEqual(expectedAction);
});
});
......
......@@ -231,28 +231,6 @@ describe('windows reducer', () => {
});
});
it('should handle UPDATE_VIEWPORT', () => {
expect(windowsReducer({
abc123: {
id: 'abc123',
},
def456: {
id: 'def456',
},
}, {
type: ActionTypes.UPDATE_VIEWPORT,
windowId: 'abc123',
payload: { x: 0, y: 1, zoom: 0.5 },
})).toEqual({
abc123: {
id: 'abc123',
viewer: { x: 0, y: 1, zoom: 0.5 },
},
def456: {
id: 'def456',
},
});
});
it('should handle SET_WINDOW_SIZE', () => {
expect(windowsReducer({
abc123: {
......@@ -285,6 +263,7 @@ describe('windows reducer', () => {
},
});
});
it('should handle UPDATE_WINDOW_POSITION', () => {
expect(windowsReducer({
abc123: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment