summaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/DeployLoop.test.js
diff options
context:
space:
mode:
authorxuegao <xg353y@intl.att.com>2019-10-07 14:36:34 +0200
committerxuegao <xg353y@intl.att.com>2019-10-07 14:36:34 +0200
commit0efeb6b141cb4abe84af8eb38e26d5ed1ab73bb0 (patch)
tree8c716d7b22828b13a796aa924b1e156a51b9e420 /ui-react/src/components/dialogs/DeployLoop.test.js
parent52432d6512d2477ad16d46f5ab31a8f77e9f77bd (diff)
Fix Sonar vulnerabilities
Fix the vulnerabilities reported by Sonar. Issue-ID: CLAMP-530 Change-Id: I9f6a7fe9ce042045085c371ef3777188b11ffb36 Signed-off-by: xuegao <xg353y@intl.att.com>
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 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(<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();
});