diff options
author | sebdet <sebastien.determe@intl.att.com> | 2020-05-18 12:31:11 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2020-05-20 18:00:03 +0200 |
commit | c0ec0fc448af1c5d6eacb195e95938c921ba1bce (patch) | |
tree | f294596a5aa001f76fa4cd6f1a3c88d669fadd32 /ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js | |
parent | 061ecec6a6099ad7fb480b0fe67f6e5154f9db23 (diff) |
Create SVG in UI
Remove the SVG generation from the backend and put it in the UI
Issue-ID: CLAMP-854
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: Icfa9e107d83bb244ac3d87300d013555bfa0b037
Diffstat (limited to 'ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js')
-rw-r--r-- | ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js b/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js index f362cfaa6..1865869df 100644 --- a/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js +++ b/ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js @@ -23,6 +23,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import OpenLoopModal from './OpenLoopModal'; +import LoopService from '../../../api/LoopService'; describe('Verify OpenLoopModal', () => { @@ -41,10 +42,19 @@ describe('Verify OpenLoopModal', () => { expect(component).toMatchSnapshot(); }); - it('Onchange event', () => { + it('Onchange event', async () => { + const flushPromises = () => new Promise(setImmediate); + LoopService.getLoop = jest.fn().mockImplementation(() => { + return Promise.resolve({ + ok: true, + status: 200, + json: () => {} + }); + }); const event = {value: 'LOOP_gmtAS_v1_0_ResourceInstanceName1_tca_3'}; const component = shallow(<OpenLoopModal/>); component.find('StateManager').simulate('change', event); + await flushPromises(); component.update(); expect(component.state('chosenLoopName')).toEqual("LOOP_gmtAS_v1_0_ResourceInstanceName1_tca_3"); }); |