summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test-utils/factories/softwareProduct
diff options
context:
space:
mode:
authorAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
committerAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
commitb8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch)
treef78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-ui/test-utils/factories/softwareProduct
parent75aacbbe1acf78fa53378f07f0a8c7769449a17e (diff)
[SDC] Onboarding 1710 rebase.
Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535 Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-ui/test-utils/factories/softwareProduct')
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsComputeFactory.js16
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js2
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js28
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsNetworkFactories.js23
-rw-r--r--openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductDeploymentFactories.js33
5 files changed, 85 insertions, 17 deletions
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsComputeFactory.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsComputeFactory.js
index 58e5db7a7d..6e751dcc53 100644
--- a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsComputeFactory.js
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsComputeFactory.js
@@ -14,8 +14,9 @@
* permissions and limitations under the License.
*/
import {Factory} from 'rosie';
+import randomstring from 'randomstring';
-export default new Factory()
+export const ComputeFlavorQData = new Factory()
.attrs({
'vmSizing':{
'numOfCPUs': 3,
@@ -26,6 +27,19 @@ export default new Factory()
}
});
+export const ComputeFlavorBaseData = new Factory()
+ .attrs({
+ name: () => randomstring.generate(),
+ description: () => randomstring.generate(),
+ id: randomstring.generate()
+ });
+
+export const ComponentComputeFactory = new Factory()
+ .attrs({
+ computesList: [],
+ computeEditor: {}
+ });
+
export const VSPComponentsComputeDataMapFactory = new Factory()
.attrs({
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js
index a98249bf14..1a356be315 100644
--- a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js
@@ -22,6 +22,8 @@ export const VSPComponentsFactory = new Factory()
.attr('displayName', ['componentName', 'componentType'], (componentName, componentType) => `${componentName}_${componentType}`)
.attr('name', ['displayName'], displayName => `com.ecomp.d2.resource.vfc.nodes.heat.${displayName}`)
.attr('id', () => randomstring.generate())
+ .attr('vfcCode', 'code')
+ .attr('nfcFunction', 'function')
.attr('description', 'description');
export const VSPComponentsGeneralFactory = new Factory()
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js
index 6bfa091fd3..550e1a6d6c 100644
--- a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsMonitoringFactories.js
@@ -15,18 +15,24 @@
*/
import {Factory} from 'rosie';
import randomstring from 'randomstring';
+import {type2Name, fileTypes} from 'sdc-app/onboarding/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoringConstants.js';
+
+export const trap = type2Name[fileTypes.SNMP_TRAP];
+export const poll = type2Name[fileTypes.SNMP_POLL];
+export const ves = type2Name[fileTypes.VES_EVENT];
export const VSPComponentsMonitoringRestFactory = new Factory()
- .option('snmpTrapFlag', false)
- .option('snmpPollFlag', false)
- .attr('snmpTrap', ['snmpTrapFlag'], snmpTrapFlag => snmpTrapFlag ? randomstring.generate() : undefined)
- .attr('snmpPoll', ['snmpPollFlag'], snmpPollFlag => snmpPollFlag ? randomstring.generate() : undefined);
+ .option('createTrap', false)
+ .option('createPoll', false)
+ .option('createVes', false)
+
+ .attr(trap, ['createTrap'], (createTrap) => {return (createTrap) ? randomstring.generate() : undefined})
+ .attr(poll, ['createPoll'], (createPoll) => {return (createPoll) ? randomstring.generate() : undefined})
+ .attr(ves, ['createVes'], (createVes) => {return (createVes) ? randomstring.generate() : undefined});
+
export const VSPComponentsMonitoringViewFactory = new Factory()
- .extend(VSPComponentsMonitoringRestFactory)
- .after(monitoring => {
- monitoring['trapFilename'] = monitoring['snmpTrap'];
- monitoring['pollFilename'] = monitoring['snmpPoll'];
- delete monitoring['snmpTrap'];
- delete monitoring['snmpPoll'];
- });
+ .extend(VSPComponentsMonitoringRestFactory);
+// .after(monitoring => {
+
+// });
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsNetworkFactories.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsNetworkFactories.js
index f08d282131..1226ec8317 100644
--- a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsNetworkFactories.js
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductComponentsNetworkFactories.js
@@ -17,6 +17,13 @@ import {Factory} from 'rosie';
import randomstring from 'randomstring';
import IdMixin from 'test-utils/factories/mixins/IdMixin.js';
+export const VSPComponentsNicPostFactory = new Factory()
+.attrs({
+ name: () => randomstring.generate(),
+ description: () => randomstring.generate(),
+ networkDescription: () => randomstring.generate(),
+ networkType: 'External'
+});
export const VSPComponentsNicFactory = new Factory()
.attrs({
name: () => randomstring.generate(),
@@ -32,7 +39,8 @@ export const VSPComponentsNicWithIdFactory = new Factory()
export const VSPComponentsNetworkFactory = new Factory()
.attrs({
nicEditor: {},
- nicList: []
+ nicList: [],
+ nicCreation: {}
});
export const VSPComponentsNetworkQDataFactory = new Factory()
@@ -57,13 +65,18 @@ export const VSPComponentsNicFactoryGenericFieldInfo = new Factory()
.attrs({
'description' : {
isValid: true,
- errorText: '',
- validations: []
+ errorText: '',
+ validations: []
},
'name' : {
isValid: true,
- errorText: '',
- validations: []
+ errorText: '',
+ validations: [{type: 'required', data : true}]
+ },
+ 'networkDescription' : {
+ isValid: true,
+ errorText: '',
+ validations: []
}
});
diff --git a/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductDeploymentFactories.js b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductDeploymentFactories.js
new file mode 100644
index 0000000000..0f81abae61
--- /dev/null
+++ b/openecomp-ui/test-utils/factories/softwareProduct/SoftwareProductDeploymentFactories.js
@@ -0,0 +1,33 @@
+/*!
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+import {Factory} from 'rosie';
+import IdMixin from 'test-utils/factories/mixins/IdMixin.js';
+import randomstring from 'randomstring';
+
+Factory.define('VSPDeploymentBaseFactory')
+ .attrs({
+ name: () => randomstring.generate(),
+ selectedComponent: () => randomstring.generate(),
+ selectedFeatureGroup: () => randomstring.generate(),
+ description: 'string'
+ });
+
+export const VSPDeploymentPostFactory = new Factory()
+ .extend('VSPDeploymentBaseFactory');
+
+export const VSPDeploymentStoreFactory = new Factory()
+ .extend('VSPDeploymentBaseFactory')
+ .extend(IdMixin); \ No newline at end of file