aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/DeployLoop.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui-react/src/components/dialogs/DeployLoop.test.js')
-rw-r--r--ui-react/src/components/dialogs/DeployLoop.test.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/ui-react/src/components/dialogs/DeployLoop.test.js b/ui-react/src/components/dialogs/DeployLoop.test.js
index 2959ed652..44bc78379 100644
--- a/ui-react/src/components/dialogs/DeployLoop.test.js
+++ b/ui-react/src/components/dialogs/DeployLoop.test.js
@@ -61,6 +61,7 @@ describe('Verify DeployLoop', () => {
const flushPromises = () => new Promise(setImmediate);
const historyMock = { push: jest.fn() };
const updateLoopFunction = jest.fn();
+ const showAlert = jest.fn();
const handleSave = jest.spyOn(DeployLoop.prototype,'handleSave');
LoopService.updateGlobalProperties = jest.fn().mockImplementation(() => {
return Promise.resolve({
@@ -83,10 +84,9 @@ describe('Verify DeployLoop', () => {
json: () => {}
});
});
- const jsdomAlert = window.alert;
- window.alert = () => {};
+
const component = shallow(<DeployLoop history={historyMock}
- loopCache={loopCache} updateLoopFunction={updateLoopFunction} />)
+ loopCache={loopCache} updateLoopFunction={updateLoopFunction} showAlert={showAlert} />)
component.find('[variant="primary"]').prop('onClick')();
await flushPromises();
@@ -95,7 +95,6 @@ describe('Verify DeployLoop', () => {
expect(handleSave).toHaveBeenCalledTimes(1);
expect(component.state('show')).toEqual(false);
expect(historyMock.push.mock.calls[0]).toEqual([ '/']);
- window.alert = jsdomAlert;
handleSave.mockClear();
});