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';
23 import CurrentScreenFactory from 'test-utils/factories/common/CurrentScreenFactory.js';
25 describe('Software Product Deployment Editor Module Tests', function () {
27 it('should mapper exist', () => {
28 expect(mapStateToProps).toBeTruthy();
31 it('should return empty data', () => {
33 const currentSoftwareProduct = VSPEditorFactoryWithLicensingData.build();
34 const componentsList = VSPComponentsFactory.buildList(1);
35 const featureGroupsList = FeatureGroupStoreFactory.buildList(2);
36 const currentScreen = CurrentScreenFactory.build();
41 softwareProductEditor: {
42 data: currentSoftwareProduct
44 softwareProductDeployment:
46 deploymentFlavors: [],
47 deploymentFlavorEditor: {data: {}}
49 softwareProductComponents: {
63 var results = mapStateToProps(state);
64 expect(results.data).toEqual({});
67 it('jsx view test', () => {
68 const componentsList = VSPComponentsFactory.buildList(1);
69 var renderer = TestUtils.createRenderer();
71 <SoftwareProductDeploymentEditorView
73 selectedFeatureGroupsList={[]}
74 componentsList={componentsList}
76 onDataChanged={() => {}}
80 var renderedOutput = renderer.getRenderOutput();
81 expect(renderedOutput).toBeTruthy();