From b13a790d9b783a393effb473c91eed9244d86c61 Mon Sep 17 00:00:00 2001 From: sebdet Date: Fri, 15 Nov 2019 17:26:45 +0100 Subject: [PATCH] Fix naming convention Second stage, fix naming convention in UI-react so that it's clearer Issue-ID: CLAMP-552 Change-Id: I1bfd48b55d9e1edf66c0369539718e086a778429 Signed-off-by: sebdet --- ui-react/src/LoopUI.js | 4 ++-- .../LoopPropertiesModal.js} | 4 ++-- .../LoopPropertiesModal.test.js} | 20 ++++++++++---------- .../__snapshots__/LoopPropertiesModal.test.js.snap} | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) rename ui-react/src/components/dialogs/{LoopProperties.js => Loop/LoopPropertiesModal.js} (96%) rename ui-react/src/components/dialogs/{LoopProperties.test.js => Loop/LoopPropertiesModal.test.js} (83%) rename ui-react/src/components/dialogs/{__snapshots__/LoopProperties.test.js.snap => Loop/__snapshots__/LoopPropertiesModal.test.js.snap} (94%) diff --git a/ui-react/src/LoopUI.js b/ui-react/src/LoopUI.js index bcdc4ffe..e709c71f 100644 --- a/ui-react/src/LoopUI.js +++ b/ui-react/src/LoopUI.js @@ -39,7 +39,7 @@ import { Route } from 'react-router-dom' import OpenLoopModal from './components/dialogs/OpenLoop/OpenLoopModal'; import OperationalPolicyModal from './components/dialogs/OperationalPolicy/OperationalPolicyModal'; import ConfigurationPolicyModal from './components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal'; -import LoopProperties from './components/dialogs/LoopProperties'; +import LoopPropertiesModal from './components/dialogs/Loop/LoopPropertiesModal'; import UserInfo from './components/dialogs/UserInfo'; import LoopService from './api/LoopService'; import ViewToscaModal from './components/dialogs/ViewToscaModal/ViewToscaModal'; @@ -253,7 +253,7 @@ export default class LoopUI extends React.Component { render={(routeProps) => ()} /> ()} /> ()} /> - ()} /> + ()} /> ()} /> ()} /> diff --git a/ui-react/src/components/dialogs/LoopProperties.js b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js similarity index 96% rename from ui-react/src/components/dialogs/LoopProperties.js rename to ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js index 990fe775..73946f45 100644 --- a/ui-react/src/components/dialogs/LoopProperties.js +++ b/ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js @@ -25,12 +25,12 @@ import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; import Form from 'react-bootstrap/Form'; import styled from 'styled-components'; -import LoopService from '../../api/LoopService'; +import LoopService from '../../../api/LoopService'; const ModalStyled = styled(Modal)` background-color: transparent; ` -export default class LoopProperties extends React.Component { +export default class LoopPropertiesModal extends React.Component { state = { show: true, 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(); diff --git a/ui-react/src/components/dialogs/__snapshots__/LoopProperties.test.js.snap b/ui-react/src/components/dialogs/Loop/__snapshots__/LoopPropertiesModal.test.js.snap similarity index 94% rename from ui-react/src/components/dialogs/__snapshots__/LoopProperties.test.js.snap rename to ui-react/src/components/dialogs/Loop/__snapshots__/LoopPropertiesModal.test.js.snap index c7e81c39..fe9aee2a 100644 --- a/ui-react/src/components/dialogs/__snapshots__/LoopProperties.test.js.snap +++ b/ui-react/src/components/dialogs/Loop/__snapshots__/LoopPropertiesModal.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Verify LoopProperties Test the render method 1`] = ` +exports[`Verify LoopPropertiesModal Test the render method 1`] = `