aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test/onboard
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-04-22 14:14:31 +0300
committerEinav Keidar <einavw@amdocs.com>2018-04-22 12:19:13 +0000
commit57c5c4ab80cde4290cac97a6eba3dc7de280538a (patch)
tree450d14403035554ca79f0de55c40c81b71e7740e /openecomp-ui/test/onboard
parenteb4b9fb0f4d3b62f3b9e2da81ebe581e7d0fc6eb (diff)
attachment page navigation fix
Issue-ID: SDC-1239 Change-Id: Ib597238233e9a035944b7a56a56601cdfd624ca2 Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/test/onboard')
-rw-r--r--openecomp-ui/test/onboard/filter/filter.test.js14
-rw-r--r--openecomp-ui/test/onboard/test.js30
2 files changed, 37 insertions, 7 deletions
diff --git a/openecomp-ui/test/onboard/filter/filter.test.js b/openecomp-ui/test/onboard/filter/filter.test.js
index 1b89a306bf..bf9ce63346 100644
--- a/openecomp-ui/test/onboard/filter/filter.test.js
+++ b/openecomp-ui/test/onboard/filter/filter.test.js
@@ -24,7 +24,8 @@ import {
import { FilterFactory } from 'test-utils/factories/onboard/FilterFactories.js';
import {
itemStatus,
- versionStatus
+ versionStatus,
+ itemPermissions
} from 'sdc-app/common/helpers/ItemsHelperConstants.js';
import OnboardActionHelper from 'sdc-app/onboarding/onboard/OnboardActionHelper.js';
import { tabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
@@ -46,7 +47,9 @@ describe('Onboard Filter Tests', () => {
expect(baseUrl).toEqual(
`/onboarding-api/v1.0/items?&itemStatus=${
itemStatus.ACTIVE
- }&versionStatus=${versionStatus.DRAFT}`
+ }&versionStatus=${versionStatus.DRAFT}&permission=${
+ itemPermissions.OWNER
+ },${itemPermissions.CONTRIBUTOR}`
);
expect(data).toEqual(undefined);
expect(options).toEqual(undefined);
@@ -62,10 +65,7 @@ describe('Onboard Filter Tests', () => {
done();
});
});
- /**
- * TODO Turn ON when FILTER TOGGLE Will BE REMOVED
- */
- /*
+
it('load certifed data', done => {
const store = storeCreator();
@@ -112,7 +112,7 @@ describe('Onboard Filter Tests', () => {
done();
});
});
- */
+
it('onboarding tabs switching filter updates', done => {
const store = storeCreator();
diff --git a/openecomp-ui/test/onboard/test.js b/openecomp-ui/test/onboard/test.js
index a75070bf26..b2131ceed5 100644
--- a/openecomp-ui/test/onboard/test.js
+++ b/openecomp-ui/test/onboard/test.js
@@ -20,6 +20,11 @@ import OnboardingCatalogActionHelper from 'sdc-app/onboarding/onboard/onboarding
import { tabsMapping as onboardTabsMapping } from 'sdc-app/onboarding/onboard/OnboardConstants.js';
import { tabsMapping as onboardCatalogTabsMapping } from 'sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogConstants.js';
import { FilterFactory } from 'test-utils/factories/onboard/FilterFactories.js';
+import mockRest from 'test-utils/MockRest.js';
+import {
+ itemStatus,
+ versionStatus
+} from 'sdc-app/common/helpers/ItemsHelperConstants.js';
describe('Onboard Module Tests', () => {
it('should return default state', () => {
@@ -34,6 +39,18 @@ describe('Onboard Module Tests', () => {
activeTab: onboardTabsMapping.CATALOG,
filter: FilterFactory.build({ versionStatus: 'Certified' })
});
+
+ mockRest.addHandler('fetch', ({ data, options, baseUrl }) => {
+ expect(baseUrl).toEqual(
+ `/onboarding-api/v1.0/items?&itemStatus=${
+ itemStatus.ACTIVE
+ }&versionStatus=${versionStatus.CERTIFIED}`
+ );
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return { results: [] };
+ });
+
OnboardActionHelper.changeActiveTab(
store.dispatch,
onboardTabsMapping.CATALOG
@@ -62,6 +79,18 @@ describe('Onboard Module Tests', () => {
const store = storeCreator();
const expectedStore = OnboardStoreFactory.build();
OnboardActionHelper.changeSearchValue(store.dispatch, 'hello');
+
+ mockRest.addHandler('fetch', ({ data, options, baseUrl }) => {
+ expect(baseUrl).toEqual(
+ `/onboarding-api/v1.0/items?&itemStatus=${
+ itemStatus.ACTIVE
+ }&versionStatus=${versionStatus.CERTIFIED}`
+ );
+ expect(data).toEqual(undefined);
+ expect(options).toEqual(undefined);
+ return { results: [] };
+ });
+
OnboardActionHelper.changeActiveTab(
store.dispatch,
onboardTabsMapping.CATALOG
@@ -70,6 +99,7 @@ describe('Onboard Module Tests', () => {
store.dispatch,
onboardCatalogTabsMapping.ACTIVE
);
+
OnboardActionHelper.resetOnboardStore(store.dispatch, 'hello');
expect(store.getState().onboard).toEqual(expectedStore);
});