Skip to content
Snippets Groups Projects
Commit da66dd97 authored by Ben Wheeler's avatar Ben Wheeler
Browse files

fixed tests

parent 49ada608
No related branches found
No related tags found
No related merge requests found
...@@ -105,8 +105,9 @@ test('related alerts can clear each other', () => { ...@@ -105,8 +105,9 @@ test('related alerts can clear each other', () => {
}; };
const action = showStandardAlert('saveSuccess'); const action = showStandardAlert('saveSuccess');
const resultState = alertsReducer(initialState, action); const resultState = alertsReducer(initialState, action);
expect(resultState.alertsList.length).toBe(1); expect(resultState.alertsList.length).toBe(2);
expect(resultState.alertsList[0].alertId).toBe('saveSuccess'); expect(resultState.alertsList[0].alertId).toBe('creating');
expect(resultState.alertsList[1].alertId).toBe('saveSuccess');
}); });
test('several related alerts can be cleared at once', () => { test('several related alerts can be cleared at once', () => {
......
...@@ -178,7 +178,7 @@ describe('projectSaverHOC', () => { ...@@ -178,7 +178,7 @@ describe('projectSaverHOC', () => {
}); });
test('if we enter remixing state, vm project should be requested, and alert should show', () => { test('if we enter remixing state, vm project should be requested, and alert should show', () => {
const mockedShowCreatingAlert = jest.fn(); const mockedShowCreatingRemixAlert = jest.fn();
const Component = () => <div />; const Component = () => <div />;
const WrappedComponent = projectSaverHOC(Component); const WrappedComponent = projectSaverHOC(Component);
const mockedStoreProject = jest.fn(() => Promise.resolve()); const mockedStoreProject = jest.fn(() => Promise.resolve());
...@@ -197,7 +197,7 @@ describe('projectSaverHOC', () => { ...@@ -197,7 +197,7 @@ describe('projectSaverHOC', () => {
reduxProjectId={'100'} reduxProjectId={'100'}
store={store} store={store}
vm={vm} vm={vm}
onShowCreatingAlert={mockedShowCreatingAlert} onShowCreatingRemixAlert={mockedShowCreatingRemixAlert}
/> />
); );
mounted.setProps({ mounted.setProps({
...@@ -205,11 +205,11 @@ describe('projectSaverHOC', () => { ...@@ -205,11 +205,11 @@ describe('projectSaverHOC', () => {
loadingState: LoadingState.REMIXING loadingState: LoadingState.REMIXING
}); });
expect(mockedStoreProject).toHaveBeenCalled(); expect(mockedStoreProject).toHaveBeenCalled();
expect(mockedShowCreatingAlert).toHaveBeenCalled(); expect(mockedShowCreatingRemixAlert).toHaveBeenCalled();
}); });
test('if we enter creating copy state, vm project should be requested, and alert should show', () => { test('if we enter creating copy state, vm project should be requested, and alert should show', () => {
const mockedShowCreatingAlert = jest.fn(); const mockedShowCreatingCopyAlert = jest.fn();
const Component = () => <div />; const Component = () => <div />;
const WrappedComponent = projectSaverHOC(Component); const WrappedComponent = projectSaverHOC(Component);
const mockedStoreProject = jest.fn(() => Promise.resolve()); const mockedStoreProject = jest.fn(() => Promise.resolve());
...@@ -228,7 +228,7 @@ describe('projectSaverHOC', () => { ...@@ -228,7 +228,7 @@ describe('projectSaverHOC', () => {
reduxProjectId={'100'} reduxProjectId={'100'}
store={store} store={store}
vm={vm} vm={vm}
onShowCreatingAlert={mockedShowCreatingAlert} onShowCreatingCopyAlert={mockedShowCreatingCopyAlert}
/> />
); );
mounted.setProps({ mounted.setProps({
...@@ -236,7 +236,7 @@ describe('projectSaverHOC', () => { ...@@ -236,7 +236,7 @@ describe('projectSaverHOC', () => {
loadingState: LoadingState.CREATING_COPY loadingState: LoadingState.CREATING_COPY
}); });
expect(mockedStoreProject).toHaveBeenCalled(); expect(mockedStoreProject).toHaveBeenCalled();
expect(mockedShowCreatingAlert).toHaveBeenCalled(); expect(mockedShowCreatingCopyAlert).toHaveBeenCalled();
}); });
test('if we enter updating/saving state, vm project should be requested', () => { test('if we enter updating/saving state, vm project should be requested', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment