2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 import { storeCreator } from 'sdc-app/AppStore.js';
17 import { OnboardingCatalogStoreFactory } from 'test-utils/factories/onboard/OnboardingCatalogFactories.js';
18 import { LicenseModelStoreFactory } from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
19 import OnboardingCatalogActionHelper from 'sdc-app/onboarding/onboard/onboardingCatalog/OnboardingCatalogActionHelper.js';
21 describe('Onboarding Catalog Module Tests', () => {
22 it('should return default state', () => {
23 const store = storeCreator();
24 const expectedStore = OnboardingCatalogStoreFactory.build();
25 expect(store.getState().onboard.onboardingCatalog).toEqual(
30 it('should change VSP Overlay', () => {
31 const vendor = LicenseModelStoreFactory.build();
32 const store = storeCreator();
33 const expectedStore = OnboardingCatalogStoreFactory.build({
34 vendorCatalog: { vspOverlay: vendor.id }
36 OnboardingCatalogActionHelper.changeVspOverlay(store.dispatch, vendor);
37 expect(store.getState().onboard.onboardingCatalog).toEqual(
42 it('should close VSP Overlay', () => {
43 const vendor = LicenseModelStoreFactory.build();
44 const store = storeCreator();
45 const expectedStore = OnboardingCatalogStoreFactory.build({
46 vendorCatalog: { vspOverlay: null }
48 OnboardingCatalogActionHelper.changeVspOverlay(store.dispatch, vendor);
49 OnboardingCatalogActionHelper.changeVspOverlay(store.dispatch, null);
50 expect(store.getState().onboard.onboardingCatalog).toEqual(
55 it('should select vendor', () => {
56 const vendor = LicenseModelStoreFactory.build();
57 const store = storeCreator();
58 const expectedStore = OnboardingCatalogStoreFactory.build({
59 vendorCatalog: { selectedVendor: vendor }
61 OnboardingCatalogActionHelper.onVendorSelect(store.dispatch, {
64 expect(store.getState().onboard.onboardingCatalog).toEqual(