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-addons-test-utils';
19 import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditor.js';
20 import SoftwareProductProcessesEditorView from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditorView.jsx';
21 import {VSPEditorFactory} from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js';
23 describe('Software Product Processes Editor Module Tests', function () {
25 it('should mapper exist', () => {
26 expect(mapStateToProps).toBeTruthy();
29 it('should return empty data', () => {
31 const currentSoftwareProduct = VSPEditorFactory.build();
35 softwareProductEditor: {
36 data: currentSoftwareProduct
38 softwareProductProcesses:
41 processesEditor: {data: {}}
46 var results = mapStateToProps(state);
47 expect(results.data).toEqual({});
48 expect(results.previousData).toEqual(undefined);
51 it('jsx view test', () => {
52 var view = TestUtils.renderIntoDocument(<SoftwareProductProcessesEditorView
56 onDataChanged={() => {}}
58 onClose={() => {}}/>);
59 expect(view).toBeTruthy();