2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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
13 * or implied. See the License for the specific language governing
14 * permissions and limitations under the License.
17 import React from 'react';
18 import TestUtils from 'react-addons-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.isReadOnlyMode).toEqual(true);
59 expect(result.description).toEqual(obj.licenseModel.licenseModelEditor.data.description);
60 expect(result.counts).toEqual(counts);
63 it('jsx view test', () => {
66 {name: overviewItems.LICENSE_AGREEMENTS, count: 0},
67 {name: overviewItems.FEATURE_GROUPS, count: 0},
68 {name: overviewItems.ENTITLEMENT_POOLS, count: 0},
69 {name: overviewItems.LICENSE_KEY_GROUPS, count: 0},
72 var view = TestUtils.renderIntoDocument(<SummaryCountList counts={counts} licenseModelId='1' isReadOnlyMode={false}/>);
73 expect(view).toBeTruthy();
76 it('description editor jsx view test', () => {
77 var data = LicenseModelStoreFactory.build();
78 var genericFieldInfo = {
83 var view = TestUtils.renderIntoDocument(<LicenseModelDescriptionEdit data={data} genericFieldInfo={genericFieldInfo} description='desc'/>);
84 expect(view).toBeTruthy();