[SDC] OnBoard with enabled tests and features

Change-Id: I4c1bbf6e1c854cf97a3561c736f83da44b58b7c0
Signed-off-by: az2497 <avi.ziv@amdocs.com>

[SDC] OnBoard with enabled tests and features.

Change-Id: Icd52f039aee4dd393a1404d530bb9fdd0b20e604
Signed-off-by: az2497 <avi.ziv@amdocs.com>
diff --git a/openecomp-ui/test/licenseModel/entitlementPools/test.js b/openecomp-ui/test/licenseModel/entitlementPools/test.js
index 911fb01..f541523 100644
--- a/openecomp-ui/test/licenseModel/entitlementPools/test.js
+++ b/openecomp-ui/test/licenseModel/entitlementPools/test.js
@@ -21,6 +21,7 @@
 import {EntitlementPoolStoreFactory, EntitlementPoolPostFactory} from 'test-utils/factories/licenseModel/EntitlementPoolFactories.js';
 import VersionControllerUtilsFactory from 'test-utils/factories/softwareProduct/VersionControllerUtilsFactory.js';
 import {LimitItemFactory, LimitPostFactory} from 'test-utils/factories/licenseModel/LimitFactories.js';
+import {getStrValue} from 'nfvo-utils/getValue.js';
 
 describe('Entitlement Pools Module Tests', function () {
 
@@ -165,7 +166,7 @@
 
 	it('Load Limits List', () => {
 
-		const limitsList = LimitItemFactory.buildList(3);		
+		const limitsList = LimitItemFactory.buildList(3);
 		deepFreeze(limitsList);
 		const store = storeCreator();
 		deepFreeze(store.getState());
@@ -190,8 +191,12 @@
 		deepFreeze(store.getState());
 
 		const limitToAdd = LimitPostFactory.build();
+		let limitFromBE = {...limitToAdd};
+		limitFromBE.metric = getStrValue(limitFromBE.metric);
+		limitFromBE.unit = getStrValue(limitFromBE.unit);
 
 		deepFreeze(limitToAdd);
+		deepFreeze(limitFromBE);
 
 		const LimitIdFromResponse = 'ADDED_ID';
 		const limitAddedItem = {...limitToAdd, id: LimitIdFromResponse};
@@ -202,7 +207,7 @@
 
 		mockRest.addHandler('post', ({data, options, baseUrl}) => {
 			expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/entitlement-pools/${entitlementPool.id}/limits`);
-			expect(data).toEqual(limitToAdd);
+			expect(data).toEqual(limitFromBE);
 			expect(options).toEqual(undefined);
 			return {
 				returnCode: 'OK',
@@ -220,7 +225,7 @@
 		return EntitlementPoolsActionHelper.submitLimit(store.dispatch,
 			{
 				licenseModelId: LICENSE_MODEL_ID,
-				version,				
+				version,
 				entitlementPool,
 				limit: limitToAdd
 			}
@@ -232,9 +237,9 @@
 
 	it('Delete Limit', () => {
 
-		const limitsList = LimitItemFactory.buildList(1);		
+		const limitsList = LimitItemFactory.buildList(1);
 		deepFreeze(limitsList);
-					
+
 		const store = storeCreator({
 			licenseModel: {
 				entitlementPool: {
@@ -279,7 +284,7 @@
 
 	it('Update Limit', () => {
 
-		const limitsList = LimitItemFactory.buildList(1);		
+		const limitsList = LimitItemFactory.buildList(1);
 		deepFreeze(limitsList);
 		const entitlementPool = EntitlementPoolStoreFactory.build();
 		const store = storeCreator({
@@ -294,16 +299,20 @@
 
 		deepFreeze(store.getState());
 
-		
+
 		const previousData = limitsList[0];
+
 		deepFreeze(previousData);
 		const limitId = limitsList[0].id;
-		
-		const updatedLimit = {...previousData, name: 'updatedLimit'};
-		deepFreeze(updatedLimit);
-		const updatedLimitForPut = {...updatedLimit, id: undefined};
 
-		const expectedStore = cloneAndSet(store.getState(), 'licenseModel.entitlementPool.entitlementPoolEditor.limitsList', [updatedLimit]);
+		let updatedLimit = {...previousData, name: 'updatedLimit'};
+
+		const updatedLimitForPut = {...updatedLimit, id: undefined};
+		updatedLimit.metric = {choice: updatedLimit.metric, other: ''};
+		updatedLimit.unit = {choice: updatedLimit.unit, other: ''};
+		deepFreeze(updatedLimit);
+
+		const expectedStore = cloneAndSet(store.getState(), 'licenseModel.entitlementPool.entitlementPoolEditor.limitsList', [updatedLimitForPut]);
 
 
 		mockRest.addHandler('put', ({data, options, baseUrl}) => {
@@ -317,13 +326,13 @@
 			expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/entitlement-pools/${entitlementPool.id}/limits`);
 			expect(data).toEqual(undefined);
 			expect(options).toEqual(undefined);
-			return {results: [updatedLimit]};
+			return {results: [updatedLimitForPut]};
 		 });
 
 		return EntitlementPoolsActionHelper.submitLimit(store.dispatch,
 			{
 				licenseModelId: LICENSE_MODEL_ID,
-				version,				
+				version,
 				entitlementPool,
 				limit: updatedLimit
 			}
diff --git a/openecomp-ui/test/licenseModel/licenseKeyGroups/test.js b/openecomp-ui/test/licenseModel/licenseKeyGroups/test.js
index 77fcc00..739e266 100644
--- a/openecomp-ui/test/licenseModel/licenseKeyGroups/test.js
+++ b/openecomp-ui/test/licenseModel/licenseKeyGroups/test.js
@@ -22,6 +22,7 @@
 import LicenseKeyGroupsActionHelper from 'sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsActionHelper.js';
 import VersionControllerUtilsFactory from 'test-utils/factories/softwareProduct/VersionControllerUtilsFactory.js';
 import {LimitItemFactory, LimitPostFactory} from 'test-utils/factories/licenseModel/LimitFactories.js';
+import {getStrValue} from 'nfvo-utils/getValue.js';
 
 describe('License Key Groups Module Tests', function () {
 
@@ -160,7 +161,7 @@
 
 	it('Load Limits List', () => {
 
-		const limitsList = LimitItemFactory.buildList(3);		
+		const limitsList = LimitItemFactory.buildList(3);
 		deepFreeze(limitsList);
 		const store = storeCreator();
 		deepFreeze(store.getState());
@@ -185,8 +186,12 @@
 		deepFreeze(store.getState());
 
 		const limitToAdd = LimitPostFactory.build();
+		let limitFromBE = {...limitToAdd};
+		limitFromBE.metric = getStrValue(limitFromBE.metric);
+		limitFromBE.unit = getStrValue(limitFromBE.unit);
 
 		deepFreeze(limitToAdd);
+		deepFreeze(limitFromBE);
 
 		const LimitIdFromResponse = 'ADDED_ID';
 		const limitAddedItem = {...limitToAdd, id: LimitIdFromResponse};
@@ -197,7 +202,7 @@
 
 		mockRest.addHandler('post', ({data, options, baseUrl}) => {
 			expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/license-key-groups/${licenseKeyGroup.id}/limits`);
-			expect(data).toEqual(limitToAdd);
+			expect(data).toEqual(limitFromBE);
 			expect(options).toEqual(undefined);
 			return {
 				returnCode: 'OK',
@@ -215,7 +220,7 @@
 		return LicenseKeyGroupsActionHelper.submitLimit(store.dispatch,
 			{
 				licenseModelId: LICENSE_MODEL_ID,
-				version,				
+				version,
 				licenseKeyGroup,
 				limit: limitToAdd
 			}
@@ -226,9 +231,9 @@
 
 	it('Delete Limit', () => {
 
-		const limitsList = LimitItemFactory.buildList(1);		
+		const limitsList = LimitItemFactory.buildList(1);
 		deepFreeze(limitsList);
-					
+
 		const store = storeCreator({
 			licenseModel: {
 				entitlementPool: {
@@ -273,7 +278,7 @@
 
 	it('Update Limit', () => {
 
-		const limitsList = LimitItemFactory.buildList(1);		
+		const limitsList = LimitItemFactory.buildList(1);
 		deepFreeze(limitsList);
 		const licenseKeyGroup = LicenseKeyGroupStoreFactory.build();
 		const store = storeCreator({
@@ -288,16 +293,18 @@
 
 		deepFreeze(store.getState());
 
-		
+
 		const previousData = limitsList[0];
 		deepFreeze(previousData);
 		const limitId = limitsList[0].id;
-		
-		const updatedLimit = {...previousData, name: 'updatedLimit'};
-		deepFreeze(updatedLimit);
-		const updatedLimitForPut = {...updatedLimit, id: undefined};
 
-		const expectedStore = cloneAndSet(store.getState(), 'licenseModel.licenseKeyGroup.licenseKeyGroupsEditor.limitsList', [updatedLimit]);
+		let updatedLimit = {...previousData, name: 'updatedLimit'};
+		const updatedLimitForPut = {...updatedLimit, id: undefined};
+		updatedLimit.metric = {choice: updatedLimit.metric, other: ''};
+		updatedLimit.unit = {choice: updatedLimit.unit, other: ''};
+		deepFreeze(updatedLimit);
+
+		const expectedStore = cloneAndSet(store.getState(), 'licenseModel.licenseKeyGroup.licenseKeyGroupsEditor.limitsList', [updatedLimitForPut]);
 
 
 		mockRest.addHandler('put', ({data, options, baseUrl}) => {
@@ -311,13 +318,13 @@
 			expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/license-key-groups/${licenseKeyGroup.id}/limits`);
 			expect(data).toEqual(undefined);
 			expect(options).toEqual(undefined);
-			return {results: [updatedLimit]};
+			return {results: [updatedLimitForPut]};
 		 });
 
 		return LicenseKeyGroupsActionHelper.submitLimit(store.dispatch,
 			{
 				licenseModelId: LICENSE_MODEL_ID,
-				version,				
+				version,
 				licenseKeyGroup,
 				limit: updatedLimit
 			}
diff --git a/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js b/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js
index 029ea31..b112738 100644
--- a/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js
+++ b/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js
@@ -40,7 +40,7 @@
 			</ListEditorView>
 		);
 		expect(itemView).toBeTruthy();
-		let sliderIcon = TestUtils.findRenderedDOMComponentWithClass(itemView, 'sliders');
+		let sliderIcon = TestUtils.findRenderedDOMComponentWithClass(itemView, '__sliders');
 		TestUtils.Simulate.click(sliderIcon);
 	});
 
@@ -60,7 +60,7 @@
 			</ListEditorItemView>
 		);
 		expect(itemView).toBeTruthy();
-		let sliderIcon = TestUtils.findRenderedDOMComponentWithClass(itemView, 'sliders');
+		let sliderIcon = TestUtils.findRenderedDOMComponentWithClass(itemView, '__sliders');
 		TestUtils.Simulate.click(sliderIcon);
 	});
 
@@ -71,7 +71,7 @@
 			</ListEditorItemView>
 		);
 		expect(itemView).toBeTruthy();
-		let sliderIcon = TestUtils.findRenderedDOMComponentWithClass(itemView, 'trashO');
+		let sliderIcon = TestUtils.findRenderedDOMComponentWithClass(itemView, '__trashO');
 		TestUtils.Simulate.click(sliderIcon);
 	});
 
@@ -82,7 +82,8 @@
 			</ListEditorItemView>
 		);
 		expect(itemView).toBeTruthy();
-		let trashIcon = TestUtils.scryRenderedDOMComponentsWithClass(itemView, 'fa-trash-o');
+		let trashIcon = TestUtils.scryRenderedDOMComponentsWithClass(itemView, '__trashOq');
 		expect(trashIcon).toEqual([]);
 	});
+
 });
diff --git a/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js b/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js
index 7d4d57e..e14e9b7 100644
--- a/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js
+++ b/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js
@@ -16,7 +16,7 @@
 
 
 import React from 'react';
-
+import ReactDOMServer from 'react-dom/server';
 import TestUtils from 'react-addons-test-utils';
 import {mount} from 'enzyme';
 import VersionController from 'nfvo-components/panel/versionController/VersionController.jsx';
@@ -131,21 +131,21 @@
 		let callVCActionProps = { ...props, version: '1.0', callVCAction: function(){} };
 		let versionController = mount(<VersionController isCheckedOut={true} status={statusEnum.CHECK_OUT_STATUS} {...callVCActionProps} />);
 		let elem = versionController.find('[data-test-id="vc-checkout-btn"]');
-		let svgIcon = versionController.find('.versionControllerLockClosed');
+
 		expect(elem).toBeTruthy();
 		expect(elem.length).toEqual(1);
-		expect(svgIcon.hasClass('disabled')).toBe(true);
+		expect(elem.find('.svg-icon').length).toEqual(1);
+		expect(elem.find('.svg-icon').hasClass('disabled')).toBe(true);
 	});
 
 	it('Doesn\'t show the checkout button', () => {
 		let callVCActionProps = { ...props, version: '1.0', callVCAction: function(){} };
 		let versionController = mount(<VersionController isCheckedOut={false} status={statusEnum.CHECK_IN_STATUS} {...callVCActionProps} />);
 		let elem = versionController.find('[data-test-id="vc-checkout-btn"]');
-		let svgIcon = versionController.find('.versionControllerLockClosed');
-
 		expect(elem).toBeTruthy();
 		expect(elem.length).toBe(1);
-		expect(svgIcon.hasClass('disabled')).toBe(true);
+		expect(elem.find('.svg-icon').length).toEqual(1);
+		expect(elem.find('.svg-icon').hasClass('disabled')).toBe(true);
 
 	});