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.
16 import React from 'react';
17 import ShallowRenderer from 'react-test-renderer/shallow';
18 import TestUtils from 'react-dom/test-utils';
19 import { mapStateToProps } from 'sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditor.js';
20 import SoftwareProductDeploymentEditorView from 'sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx';
21 import { VSPComponentsFactory } from 'test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js';
22 import { VSPEditorFactoryWithLicensingData } from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js';
23 import { FeatureGroupStoreFactory } from 'test-utils/factories/licenseModel/FeatureGroupFactories.js';
24 import CurrentScreenFactory from 'test-utils/factories/common/CurrentScreenFactory.js';
26 describe('Software Product Deployment Editor Module Tests', function () {
28 it('should mapper exist', () => {
29 expect(mapStateToProps).toBeTruthy();
32 it('should return empty data', () => {
34 const currentSoftwareProduct = VSPEditorFactoryWithLicensingData.build();
35 const componentsList = VSPComponentsFactory.buildList(1);
36 const featureGroupsList = FeatureGroupStoreFactory.buildList(2);
37 const currentScreen = CurrentScreenFactory.build();
42 softwareProductEditor: {
43 data: currentSoftwareProduct
45 softwareProductDeployment:
47 deploymentFlavors: [],
48 deploymentFlavorEditor: {data: {}}
50 softwareProductComponents: {
64 var results = mapStateToProps(state);
65 expect(results.data).toEqual({});
68 it('jsx view test', () => {
69 const componentsList = VSPComponentsFactory.buildList(1);
70 const renderer = new ShallowRenderer();
72 <SoftwareProductDeploymentEditorView
74 selectedFeatureGroupsList={[]}
75 componentsList={componentsList}
77 onDataChanged={() => {}}
81 var renderedOutput = renderer.getRenderOutput();
82 expect(renderedOutput).toBeTruthy();