aboutsummaryrefslogtreecommitdiffstats
path: root/ui-react/src
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-08-23 07:49:25 -0700
committersebdet <sebastien.determe@intl.att.com>2019-08-24 10:34:13 +0200
commitb65f1215e7dfab5630c0e2c1da8afec4cd08173f (patch)
tree152ae8bec276df8f9d41c4ccb48570997679cdd3 /ui-react/src
parent3142c70fb7530c444c891674fe55c6a9b236dfb3 (diff)
Update react
Update react compo to latest ones Issue-ID: CLAMP-477 Change-Id: I108b31c7e25595d96bc598f394590f23436335a1 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'ui-react/src')
-rw-r--r--ui-react/src/__test__/LoopCache.test.js27
-rw-r--r--ui-react/src/__test__/__snapshots__/OpenLoopModal.test.js.snap3
-rw-r--r--ui-react/src/api/LoopCache.js4
3 files changed, 13 insertions, 21 deletions
diff --git a/ui-react/src/__test__/LoopCache.test.js b/ui-react/src/__test__/LoopCache.test.js
index 101f864aa..1efea6495 100644
--- a/ui-react/src/__test__/LoopCache.test.js
+++ b/ui-react/src/__test__/LoopCache.test.js
@@ -85,24 +85,19 @@ describe('Verify LoopCache functions', () => {
"shared": false,
"jsonRepresentation": {"schema": {}}
};
- expect(loopCache.getMicroServicesJsonForType("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msJson);
- expect(loopCache.getMicroServicesJsonForType("TCA_h2NMX_v1_0_ResourceInstanceName1_tca_2")).toBeNull();
+ expect(loopCache.getMicroServiceForName("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msJson);
+ expect(loopCache.getMicroServiceForName("TCA_h2NMX_v1_0_ResourceInstanceName1_tca_2")).toBeNull();
});
it('getMicroServicePropertiesForName', () => {
const msProp = {"domain": "measurementsForVfScaling"};
- expect(loopCache.getMicroServiceProperties("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msProp);
- expect(loopCache.getMicroServiceProperties("TCA_h2NMX_v1_0_ResourceInstanceName1_tca_2")).toBeNull();
- });
-
- it('getMicroServiceJsonRepresentationForType', () => {
- const msJsonRepresentation = {"schema": {}};
- expect(loopCache.getMicroServiceJsonRepresentationForType("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msJsonRepresentation);
+ expect(loopCache.getMicroServicePropertiesForName("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msProp);
+ expect(loopCache.getMicroServicePropertiesForName("TCA_h2NMX_v1_0_ResourceInstanceName1_tca_2")).toBeNull();
});
it('getMicroServiceJsonRepresentationForName', () => {
const msJsonRepresentation = {"schema": {}};
- expect(loopCache.getMicroServiceJsonRepresentationForType("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msJsonRepresentation);
+ expect(loopCache.getMicroServiceJsonRepresentationForName("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(msJsonRepresentation);
});
it('getResourceDetailsVfProperty', () => {
@@ -204,14 +199,8 @@ describe('Verify LoopCache functions', () => {
});
it('updateMicroServiceProperties', () => {
- const newMsPolicy = {
- "name": "TCA_h2NMX_v1_0_ResourceInstanceName1_tca",
- "modelType": "onap.policies.monitoring.cdap.tca.hi.lo.app",
- "properties": {"domain": "measurementsForVfScalingNew"},
- "shared": true,
- "jsonRepresentation": {"schema": {}}
- };;
- loopCache.updateMicroServiceProperties("TCA_h2NMX_v1_0_ResourceInstanceName1_tca", newMsPolicy);
- expect(loopCache.getMicroServicesJsonForType("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(newMsPolicy);
+ const newMsPolicyProperties = {"domain": "measurementsForVfScalingNew"};
+ loopCache.updateMicroServiceProperties("TCA_h2NMX_v1_0_ResourceInstanceName1_tca", newMsPolicyProperties);
+ expect(loopCache.getMicroServicePropertiesForName("TCA_h2NMX_v1_0_ResourceInstanceName1_tca")).toStrictEqual(newMsPolicyProperties);
});
});
diff --git a/ui-react/src/__test__/__snapshots__/OpenLoopModal.test.js.snap b/ui-react/src/__test__/__snapshots__/OpenLoopModal.test.js.snap
new file mode 100644
index 000000000..cb8b8fd30
--- /dev/null
+++ b/ui-react/src/__test__/__snapshots__/OpenLoopModal.test.js.snap
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Verify OpenLoopModal Test the render method 1`] = `ShallowWrapper {}`;
diff --git a/ui-react/src/api/LoopCache.js b/ui-react/src/api/LoopCache.js
index d83e3ce9d..dd8c5b520 100644
--- a/ui-react/src/api/LoopCache.js
+++ b/ui-react/src/api/LoopCache.js
@@ -28,9 +28,9 @@ export default class LoopCache {
this.loopJsonCache=loopJson;
}
- updateMicroServiceProperties(type, newMsProperties) {
+ updateMicroServiceProperties(name, newMsProperties) {
for (var policy in this.loopJsonCache["microServicePolicies"]) {
- if (this.loopJsonCache["microServicePolicies"][policy]["name"] === type) {
+ if (this.loopJsonCache["microServicePolicies"][policy]["name"] === name) {
this.loopJsonCache["microServicePolicies"][policy]["properties"] = newMsProperties;
}
}