aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test
diff options
context:
space:
mode:
authorilanap <ilanap@amdocs.com>2017-09-27 11:41:19 +0300
committerilanap <ilanap@amdocs.com>2017-09-27 11:41:19 +0300
commitcb1d48383b166c9b3fa8f9034b28fb3e662c1d80 (patch)
treeec863c9cd809adb2d7d1ba2529ac3572d4a8ad60 /openecomp-ui/test
parent49d34b776677ca50c1d5b464d7b7b6dfe4c685c0 (diff)
Fix orphan list for VLMs
Fix the orphan list where feature groups stayed orphans after a license agreement that contains them was created. Issue-ID: SDC-407 Change-Id: I80b20e46fb4077ba0632e897437cfd795f134ad1 Signed-off-by: ilanap <ilanap@amdocs.com>
Diffstat (limited to 'openecomp-ui/test')
-rw-r--r--openecomp-ui/test/licenseModel/licenseAgreement/test.js28
1 files changed, 26 insertions, 2 deletions
diff --git a/openecomp-ui/test/licenseModel/licenseAgreement/test.js b/openecomp-ui/test/licenseModel/licenseAgreement/test.js
index 442f7bf91f..40b60da77f 100644
--- a/openecomp-ui/test/licenseModel/licenseAgreement/test.js
+++ b/openecomp-ui/test/licenseModel/licenseAgreement/test.js
@@ -93,7 +93,9 @@ describe('License Agreement Module Tests', () => {
id: licenseAgreementIdFromResponse
});
deepFreeze(licenseAgreementAfterAdd);
+ const licenseAgreementList = [licenseAgreementAfterAdd];
+ const featureGroupsList = licenseAgreementList.featureGroupsIds;
const expectedStore = cloneAndSet(store.getState(), 'licenseModel.licenseAgreement.licenseAgreementList', [licenseAgreementAfterAdd]);
mockRest.addHandler('post', ({options, data, baseUrl}) => {
@@ -104,7 +106,18 @@ describe('License Agreement Module Tests', () => {
value: licenseAgreementIdFromResponse
};
});
-
+ mockRest.addHandler('fetch', ({options, data, baseUrl}) => {
+ expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/license-agreements`);
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return {results: licenseAgreementList};
+ });
+ mockRest.addHandler('fetch', ({options, data, baseUrl}) => {
+ expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/feature-groups`);
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return {results: featureGroupsList};
+ });
return LicenseAgreementActionHelper.saveLicenseAgreement(store.dispatch, {
licenseAgreement: licenseAgreementToAdd,
licenseModelId: LICENSE_MODEL_ID,
@@ -151,7 +164,18 @@ describe('License Agreement Module Tests', () => {
expect(data).toEqual(LicenseAgreementPutFactoryRequest);
expect(options).toEqual(undefined);
});
-
+ mockRest.addHandler('fetch', ({options, data, baseUrl}) => {
+ expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/license-agreements`);
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return {results: [licenseAgreementUpdateData]};
+ });
+ mockRest.addHandler('fetch', ({options, data, baseUrl}) => {
+ expect(baseUrl).toEqual(`/onboarding-api/v1.0/vendor-license-models/${LICENSE_MODEL_ID}/versions/${version.id}/feature-groups`);
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return {results: newFeatureGroupsIds};
+ });
return LicenseAgreementActionHelper.saveLicenseAgreement(store.dispatch, {
licenseModelId: LICENSE_MODEL_ID,
version,