X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ui-react%2Fsrc%2Fcomponents%2Fdialogs%2FLoop%2FOpenLoopModal.test.js;h=f362cfaa6b083d14c3c0dba03871b05f70edc65c;hb=3173d554371bae1eefafc69b2bc9da5543510dd5;hp=208c947c33322643f6095959921c4e6420b48ee1;hpb=fe947238182cc1f0c962dc21938325a50a741c10;p=clamp.git diff --git a/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js b/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js index 208c947c..f362cfaa 100644 --- a/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js +++ b/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js @@ -28,12 +28,12 @@ describe('Verify OpenLoopModal', () => { beforeEach(() => { fetch.resetMocks(); - fetch.mockResponseOnce(JSON.stringify([ + fetch.mockResponse(JSON.stringify([ "LOOP_gmtAS_v1_0_ResourceInstanceName1_tca", "LOOP_gmtAS_v1_0_ResourceInstanceName1_tca_3", "LOOP_gmtAS_v1_0_ResourceInstanceName2_tca_2" ])); - }) + }); it('Test the render method', () => { @@ -44,12 +44,12 @@ describe('Verify OpenLoopModal', () => { it('Onchange event', () => { const event = {value: 'LOOP_gmtAS_v1_0_ResourceInstanceName1_tca_3'}; const component = shallow(); - component.find('StateManager').simulate('change', event); component.update(); expect(component.state('chosenLoopName')).toEqual("LOOP_gmtAS_v1_0_ResourceInstanceName1_tca_3"); }); + it('Test handleClose', () => { const historyMock = { push: jest.fn() }; const handleClose = jest.spyOn(OpenLoopModal.prototype,'handleClose');