import ViewToscaModal from './components/dialogs/ViewToscaModal/ViewToscaModal';
import PerformAction from './components/dialogs/PerformActions';
import RefreshStatus from './components/dialogs/RefreshStatus';
-import DeployLoop from './components/dialogs/DeployLoop';
+import DeployLoopModal from './components/dialogs/Loop/DeployLoopModal';
import Alert from 'react-bootstrap/Alert';
import { Link } from 'react-router-dom';
<Route path="/restart" render={(routeProps) => (<PerformAction {...routeProps} loopAction="restart" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
<Route path="/delete" render={(routeProps) => (<PerformAction {...routeProps} loopAction="delete" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
<Route path="/undeploy" render={(routeProps) => (<PerformAction {...routeProps} loopAction="undeploy" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
- <Route path="/deploy" render={(routeProps) => (<DeployLoop {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
+ <Route path="/deploy" render={(routeProps) => (<DeployLoopModal {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
<Route path="/refreshStatus" render={(routeProps) => (<RefreshStatus {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
<Route path="/logout" render={this.logout} />
<GlobalClampStyle />
*
*/
import React from 'react';
-import LoopActionService from '../../api/LoopActionService';
-import LoopService from '../../api/LoopService';
+import LoopActionService from '../../../api/LoopActionService';
+import LoopService from '../../../api/LoopService';
import Button from 'react-bootstrap/Button';
import Modal from 'react-bootstrap/Modal';
import Form from 'react-bootstrap/Form';
const FormStyled = styled(Form.Group)`
padding: .25rem 1.5rem;
`
-export default class DeployLoop extends React.Component {
+export default class DeployLoopModal extends React.Component {
state = {
loopCache: this.props.loopCache,
temporaryPropertiesJson: JSON.parse(JSON.stringify(this.props.loopCache.getGlobalProperties())),
*/
import React from 'react';
import { shallow } from 'enzyme';
-import DeployLoop from './DeployLoop';
-import LoopCache from '../../api/LoopCache';
-import LoopActionService from '../../api/LoopActionService';
-import LoopService from '../../api/LoopService';
+import DeployLoopModal from './DeployLoopModal';
+import LoopCache from '../../../api/LoopCache';
+import LoopActionService from '../../../api/LoopActionService';
+import LoopService from '../../../api/LoopService';
-describe('Verify DeployLoop', () => {
+describe('Verify DeployLoopModal', () => {
const loopCache = new LoopCache({
"name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
"globalPropertiesJson": {
it('Test the render method', () => {
const component = shallow(
- <DeployLoop loopCache={loopCache}/>
+ <DeployLoopModal loopCache={loopCache}/>
)
expect(component).toMatchSnapshot();
it('Test handleClose', () => {
const historyMock = { push: jest.fn() };
- const handleClose = jest.spyOn(DeployLoop.prototype,'handleClose');
- const component = shallow(<DeployLoop history={historyMock} loopCache={loopCache}/>)
+ const handleClose = jest.spyOn(DeployLoopModal.prototype,'handleClose');
+ const component = shallow(<DeployLoopModal history={historyMock} loopCache={loopCache}/>)
component.find('[variant="secondary"]').prop('onClick')();
const historyMock = { push: jest.fn() };
const updateLoopFunction = jest.fn();
const showAlert = jest.fn();
- const handleSave = jest.spyOn(DeployLoop.prototype,'handleSave');
+ const handleSave = jest.spyOn(DeployLoopModal.prototype,'handleSave');
LoopService.updateGlobalProperties = jest.fn().mockImplementation(() => {
return Promise.resolve({
ok: true,
});
});
- const component = shallow(<DeployLoop history={historyMock}
+ const component = shallow(<DeployLoopModal history={historyMock}
loopCache={loopCache} updateLoopFunction={updateLoopFunction} showAlert={showAlert} />)
component.find('[variant="primary"]').prop('onClick')();
it('Onchange event', () => {
const event = { target: { name: "location_id", value: "testLocation"} };
- const component = shallow(<DeployLoop loopCache={loopCache}/>);
+ const component = shallow(<DeployLoopModal loopCache={loopCache}/>);
const forms = component.find('StateManager');
component.find('[name="location_id"]').simulate('change', event);