summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test/licenseModel/licenseAgreement/test.js
diff options
context:
space:
mode:
authorAvi Gaffa <avi.gaffa@amdocs.com>2017-09-27 09:57:41 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-27 09:57:41 +0000
commitd2acdcaa8e7d43b92f2955a84bc679c31a46d9c8 (patch)
tree475684b9d4f8b42730a8026e2baa999414d53227 /openecomp-ui/test/licenseModel/licenseAgreement/test.js
parent18b81c30d2ea81b3e768839008860d1ffb77f2c8 (diff)
parentcb1d48383b166c9b3fa8f9034b28fb3e662c1d80 (diff)
Merge "Fix orphan list for VLMs"
Diffstat (limited to 'openecomp-ui/test/licenseModel/licenseAgreement/test.js')
-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,