X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ui-react%2Fsrc%2Fcomponents%2Fdialogs%2FLoop%2FLoopPropertiesModal.test.js;fp=ui-react%2Fsrc%2Fcomponents%2Fdialogs%2FLoopProperties.test.js;h=5bbefe2284705454aebec4d3d5f44b50cd238be6;hb=b13a790d9b783a393effb473c91eed9244d86c61;hp=9b74fe76a4bdeea12ac4946702d8a862f06ebae1;hpb=2e9ae128ca601171cb511d410ac9f3996a9b0513;p=clamp.git diff --git a/ui-react/src/components/dialogs/LoopProperties.test.js b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.test.js similarity index 83% rename from ui-react/src/components/dialogs/LoopProperties.test.js rename to ui-react/src/components/dialogs/Loop/LoopPropertiesModal.test.js index 9b74fe76..5bbefe22 100644 --- a/ui-react/src/components/dialogs/LoopProperties.test.js +++ b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.test.js @@ -22,11 +22,11 @@ */ import React from 'react'; import { shallow } from 'enzyme'; -import LoopProperties from './LoopProperties'; -import LoopCache from '../../api/LoopCache'; -import LoopService from '../../api/LoopService'; +import LoopPropertiesModal from './LoopPropertiesModal'; +import LoopCache from '../../../api/LoopCache'; +import LoopService from '../../../api/LoopService'; -describe('Verify LoopProperties', () => { +describe('Verify LoopPropertiesModal', () => { const loopCache = new LoopCache({ "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca", "globalPropertiesJson": { @@ -39,7 +39,7 @@ describe('Verify LoopProperties', () => { it('Test the render method', () => { const component = shallow( - + ) component.setState({ show: true, temporaryPropertiesJson: { @@ -62,8 +62,8 @@ describe('Verify LoopProperties', () => { it('Test handleClose', () => { const historyMock = { push: jest.fn() }; - const handleClose = jest.spyOn(LoopProperties.prototype,'handleClose'); - const component = shallow() + const handleClose = jest.spyOn(LoopPropertiesModal.prototype,'handleClose'); + const component = shallow() component.find('[variant="secondary"]').prop('onClick')(); @@ -75,7 +75,7 @@ describe('Verify LoopProperties', () => { const flushPromises = () => new Promise(setImmediate); const historyMock = { push: jest.fn() }; const loadLoopFunction = jest.fn(); - const handleSave = jest.spyOn(LoopProperties.prototype,'handleSave'); + const handleSave = jest.spyOn(LoopPropertiesModal.prototype,'handleSave'); LoopService.updateGlobalProperties = jest.fn().mockImplementation(() => { return Promise.resolve({ ok: true, @@ -84,7 +84,7 @@ describe('Verify LoopProperties', () => { }); }); - const component = shallow() component.find('[variant="primary"]').prop('onClick')(); @@ -98,7 +98,7 @@ describe('Verify LoopProperties', () => { it('Onchange event', () => { const event = {target:{name:"dcaeDeployParameters", value:"{\"location_id\": \"testLocation\",\"policy_id\": \"TCA_h2NMX_v1_0_ResourceInstanceName1_tca\"}"}}; - const component = shallow(); + const component = shallow(); component.find('FormControl').simulate('change', event); component.update();