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.
16 import React from 'react';
17 import TestUtils from 'react-addons-test-utils';
18 import { mapStateToProps } from 'sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditor.js';
19 import SoftwareProductDeploymentEditorView from 'sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx';
20 import { VSPComponentsFactory } from 'test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js';
21 import { VSPEditorFactoryWithLicensingData } from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js';
22 import { FeatureGroupStoreFactory } from 'test-utils/factories/licenseModel/FeatureGroupFactories.js';
24 describe('Software Product Deployment Editor Module Tests', function () {
26 it('should mapper exist', () => {
27 expect(mapStateToProps).toBeTruthy();
30 it('should return empty data', () => {
32 const currentSoftwareProduct = VSPEditorFactoryWithLicensingData.build();
33 const componentsList = VSPComponentsFactory.buildList(1);
34 const featureGroupsList = FeatureGroupStoreFactory.buildList(2);
38 softwareProductEditor: {
39 data: currentSoftwareProduct
41 softwareProductDeployment:
43 deploymentFlavors: [],
44 deploymentFlavorEditor: {data: {}}
46 softwareProductComponents: {
60 var results = mapStateToProps(state);
61 expect(results.data).toEqual({});
64 it('jsx view test', () => {
65 const componentsList = VSPComponentsFactory.buildList(1);
66 var renderer = TestUtils.createRenderer();
68 <SoftwareProductDeploymentEditorView
70 selectedFeatureGroupsList={[]}
71 componentsList={componentsList}
73 onDataChanged={() => {}}
77 var renderedOutput = renderer.getRenderOutput();
78 expect(renderedOutput).toBeTruthy();