2 * Copyright © 2016-2017 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.
17 import React from 'react';
18 import TestUtils from 'react-dom/test-utils';
20 import {mapStateToProps, SummaryCountList} from 'sdc-app/onboarding/licenseModel/overview/summary/SummaryCountList.js';
21 import LicenseModelDescriptionEdit from 'sdc-app/onboarding/licenseModel/overview/summary/LicenseModelDescriptionEdit.jsx';
22 import {overviewItems} from 'sdc-app/onboarding/licenseModel/overview/LicenseModelOverviewConstants.js';
23 import {LicenseModelOverviewFactory, LicenseModelStoreFactory} from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
25 describe('License Model Overview Summary Count List module test', () => {
27 it('should mapper exist', () => {
28 expect(mapStateToProps).toBeTruthy();
31 it('mapper data return test',() => {
34 licenseModel: LicenseModelOverviewFactory.build({
36 entitlementPoolsList: []
39 licenseAgreementList: []
45 licenseKeyGroupsList: []
51 {name: overviewItems.LICENSE_AGREEMENTS, count: 0},
52 {name: overviewItems.FEATURE_GROUPS, count: 0},
53 {name: overviewItems.ENTITLEMENT_POOLS, count: 0},
54 {name: overviewItems.LICENSE_KEY_GROUPS, count: 0},
57 var result = mapStateToProps(obj);
58 expect(result.description).toEqual(obj.licenseModel.licenseModelEditor.data.description);
59 expect(result.counts).toEqual(counts);
62 it('jsx view test', () => {
65 {name: overviewItems.LICENSE_AGREEMENTS, count: 0},
66 {name: overviewItems.FEATURE_GROUPS, count: 0},
67 {name: overviewItems.ENTITLEMENT_POOLS, count: 0},
68 {name: overviewItems.LICENSE_KEY_GROUPS, count: 0},
71 var view = TestUtils.renderIntoDocument(<SummaryCountList counts={counts} licenseModelId='1' isReadOnlyMode={false}/>);
72 expect(view).toBeTruthy();
75 it('description editor jsx view test', () => {
76 var data = LicenseModelStoreFactory.build();
77 var genericFieldInfo = {
82 var view = TestUtils.renderIntoDocument(<LicenseModelDescriptionEdit data={data} genericFieldInfo={genericFieldInfo} description='desc'/>);
83 expect(view).toBeTruthy();