aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js
diff options
context:
space:
mode:
authorash74268 <ashwin.shyam.sharma@att.com>2020-01-31 15:40:15 +0000
committersebdet <sebastien.determe@intl.att.com>2020-02-14 08:02:47 -0800
commit3a83e2a2ff88ef49535973df8dc77dc8015170da (patch)
tree7b1d9376a6a3967d9690bcc88487fb6bb7893167 /ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js
parent29e3cd1afbd3202a0c16ef6a4057662942ddefa2 (diff)
Changes include Metadata support, Upload tosca policy model and Loop Template
CLAMP Metadata support to parse policy_model_type, acronym and clamp_possible_values from the Tosca Policy Model UI and Backend changes to support Loop Template Backend APIs for Dictionary referenced in the Tosca Policy Model. Upload Tosca Model UI changes to allow user to upload policy models. DB Schema changes for the Loop Element Model and updated schema for the Dictionary Added Jest test cases and snapshots checkstyle issues fix and Junits Issue-ID: CLAMP-580 Signed-off-by: ash74268 <ashwin.shyam.sharma@att.com> Change-Id: I57521bc1c3afaf4ca5a2acf4c59823df05fd4cd6 Signed-off-by: ash74268 <ashwin.shyam.sharma@att.com>
Diffstat (limited to 'ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js')
-rw-r--r--ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js87
1 files changed, 44 insertions, 43 deletions
diff --git a/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js b/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js
index 1445e886..952e8886 100644
--- a/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js
+++ b/ui-react/src/components/dialogs/Tosca/ViewToscaPolicyModal.test.js
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP CLAMP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,12 +39,12 @@ describe('Verify ViewToscaPolicyModal', () => {
json: () => {
return Promise.resolve({
"index": "1",
- "toscaModelYaml":"MTCA",
- "toscaModelName":"DCAE_MTCAConfig",
- "version":"16",
- "userId":"aj928f",
- "policyType":"mtca",
- "lastUpdatedDate":"05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym": "TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
});
}
});
@@ -60,11 +60,12 @@ describe('Verify ViewToscaPolicyModal', () => {
json: () => {
return Promise.resolve({
"index": "1",
- "toscaModelName":"DCAE_MTCAConfig",
- "version":"16",
- "userId":"aj928f",
- "policyType":"mtca",
- "lastUpdatedDate":"05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym": "TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
});
}
});
@@ -95,12 +96,12 @@ describe('Verify ViewToscaPolicyModal', () => {
json: () => {
return Promise.resolve({
"index": "1",
- "toscaModelYaml":"MTCA",
- "toscaModelName":"DCAE_MTCAConfig",
- "version":"16",
- "userId":"aj928f",
- "policyType":"mtca",
- "lastUpdatedDate":"05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym": "TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
});
}
});
@@ -108,12 +109,12 @@ describe('Verify ViewToscaPolicyModal', () => {
const component = shallow(<ViewToscaPolicyModal/>);
component.setState({ toscaNames: {
"index": "1",
- "toscaModelYaml": "MTCA",
- "toscaModelName": "DCAE_MTCAConfig",
- "version" : "16",
- "userId" : "aj928f",
- "policyType" : "mtca",
- "lastUpdatedDate" : "05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym": "TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
}
});
expect(component).toMatchSnapshot();
@@ -127,12 +128,12 @@ describe('Verify ViewToscaPolicyModal', () => {
json: () => {
return Promise.resolve({
"index": "1",
- "toscaModelYaml":"MTCA",
- "toscaModelName":"DCAE_MTCAConfig",
- "version":"16",
- "userId":"aj928f",
- "policyType":"mtca",
- "lastUpdatedDate":"05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym": "TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
});
}
});
@@ -149,17 +150,17 @@ describe('Verify ViewToscaPolicyModal', () => {
json: () => {
return Promise.resolve({
"index": "1",
- "toscaModelYaml":"MTCA",
- "toscaModelName":"DCAE_MTCAConfig",
- "version":"16",
- "userId":"aj928f",
- "policyType":"mtca",
- "lastUpdatedDate":"05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym":"TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
});
}
});
});
- const yamlContent = 'MTCA Tosca model details';
+ const yamlContent = 'TCA Tosca model details';
const component = shallow(<ViewToscaPolicyModal/>);
component.find('[value="Please select Tosca model to view the details"]').prop('onChange')({ target: { value: yamlContent }});
expect(component.state('content')).toEqual(yamlContent);
@@ -173,12 +174,12 @@ describe('Verify ViewToscaPolicyModal', () => {
json: () => {
return Promise.resolve({
"index": "1",
- "toscaModelYaml":"MTCA",
- "toscaModelName":"DCAE_MTCAConfig",
- "version":"16",
- "userId":"aj928f",
- "policyType":"mtca",
- "lastUpdatedDate":"05-07-2019 19:09:42"
+ "policyModelTosca":"TCA",
+ "policyModelType":"onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version":"1.0.0",
+ "policyAcronym": "TCA",
+ "updatedDate": "2020-01-31T20:49:48.658795600Z",
+ "updatedBy": "admin"
});
}
});