X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ui-react%2Fsrc%2Fcomponents%2Fdialogs%2FDeployLoop.test.js;h=44bc7837980032203f63a75bb3dfcfaf4c84f3a4;hb=0efeb6b141cb4abe84af8eb38e26d5ed1ab73bb0;hp=2959ed652a603d9234c87dbe56b75d8ecf9813d6;hpb=52432d6512d2477ad16d46f5ab31a8f77e9f77bd;p=clamp.git diff --git a/ui-react/src/components/dialogs/DeployLoop.test.js b/ui-react/src/components/dialogs/DeployLoop.test.js index 2959ed65..44bc7837 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() + 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(); });