diff options
author | svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com> | 2018-04-22 14:14:31 +0300 |
---|---|---|
committer | Einav Keidar <einavw@amdocs.com> | 2018-04-22 12:19:13 +0000 |
commit | 57c5c4ab80cde4290cac97a6eba3dc7de280538a (patch) | |
tree | 450d14403035554ca79f0de55c40c81b71e7740e /openecomp-ui/test/onboard/test.js | |
parent | eb4b9fb0f4d3b62f3b9e2da81ebe581e7d0fc6eb (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/test.js')
-rw-r--r-- | openecomp-ui/test/onboard/test.js | 30 |
1 files changed, 30 insertions, 0 deletions
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); }); |