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 ShallowRenderer from 'react-test-renderer/shallow';
19 import {mapStateToProps } from 'sdc-app/onboarding/licenseModel/creation/LicenseModelCreation.js';
20 import LicenseModelCreationView from 'sdc-app/onboarding/licenseModel/creation/LicenseModelCreationView.jsx';
21 import {LicenseModelCreationFactory} from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
23 describe('License Model Creation Module Tests', function() {
24 it ('mapStateToProps mapper exists', () => {
25 expect(mapStateToProps).toBeTruthy();
28 it ('should return empty data', () => {
32 licenseModelCreation: {
40 let props = mapStateToProps(state);
41 expect(props.data).toEqual({});
44 it ('should return vlm names list', () => {
54 licenseModelCreation: {
62 let props = mapStateToProps(state);
63 expect(props.data).toEqual({});
64 expect(props.VLMNames).toEqual({vlm1: 'vlm1_id', vlm2: 'vlm2_id'});
67 it('simple jsx test', () => {
68 let data = LicenseModelCreationFactory.build();
69 const renderer = new ShallowRenderer();
71 <LicenseModelCreationView
73 onDataChanged={() => {}}
74 onValidateForm={() => {}}
78 var renderedOutput = renderer.getRenderOutput();
79 expect(renderedOutput).toBeTruthy();