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';
render={(routeProps) => (<OperationalPolicyModal {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop} showAlert={this.showAlert}/>)} />
<Route path="/configurationPolicyModal/:componentName" render={(routeProps) => (<ConfigurationPolicyModal {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
<Route path="/openLoop" render={(routeProps) => (<OpenLoopModal {...routeProps} loadLoopFunction={this.loadLoop} />)} />
- <Route path="/loopProperties" render={(routeProps) => (<LoopProperties {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
+ <Route path="/loopProperties" render={(routeProps) => (<LoopPropertiesModal {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
<Route path="/userInfo" render={(routeProps) => (<UserInfo {...routeProps} />)} />
<Route path="/closeLoop" render={this.closeLoop} />
<Route path="/submit" render={(routeProps) => (<PerformAction {...routeProps} loopAction="submit" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
*/
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": {
it('Test the render method', () => {
const component = shallow(
- <LoopProperties loopCache={loopCache}/>
+ <LoopPropertiesModal loopCache={loopCache}/>
)
component.setState({ show: true,
temporaryPropertiesJson: {
it('Test handleClose', () => {
const historyMock = { push: jest.fn() };
- const handleClose = jest.spyOn(LoopProperties.prototype,'handleClose');
- const component = shallow(<LoopProperties history={historyMock} loopCache={loopCache}/>)
+ const handleClose = jest.spyOn(LoopPropertiesModal.prototype,'handleClose');
+ const component = shallow(<LoopPropertiesModal history={historyMock} loopCache={loopCache}/>)
component.find('[variant="secondary"]').prop('onClick')();
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,
});
});
- const component = shallow(<LoopProperties history={historyMock}
+ const component = shallow(<LoopPropertiesModal history={historyMock}
loopCache={loopCache} loadLoopFunction={loadLoopFunction} />)
component.find('[variant="primary"]').prop('onClick')();
it('Onchange event', () => {
const event = {target:{name:"dcaeDeployParameters", value:"{\"location_id\": \"testLocation\",\"policy_id\": \"TCA_h2NMX_v1_0_ResourceInstanceName1_tca\"}"}};
- const component = shallow(<LoopProperties loopCache={loopCache}/>);
+ const component = shallow(<LoopPropertiesModal loopCache={loopCache}/>);
component.find('FormControl').simulate('change', event);
component.update();