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