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.
 
  17 import React from 'react';
 
  18 import TestUtils from 'react-addons-test-utils';
 
  19 import {mapStateToProps}  from 'sdc-app/onboarding/softwareProduct/components/loadBalancing/SoftwareProductComponentLoadBalancing.js';
 
  20 import SoftwareProductComponentLoadBalancingView from 'sdc-app/onboarding/softwareProduct/components/loadBalancing/SoftwareProductComponentLoadBalancingRefView.jsx';
 
  22 import {VSPEditorFactory} from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js';
 
  23 import {SoftwareProductFactory} from 'test-utils/factories/softwareProduct/SoftwareProductFactory.js';
 
  24 import {VSPComponentsVersionControllerFactory} from 'test-utils/factories/softwareProduct/SoftwareProductComponentsNetworkFactories.js';
 
  25 import VSPQSchemaFactory from 'test-utils/factories/softwareProduct/SoftwareProductQSchemaFactory.js';
 
  28 describe('SoftwareProductComponentLoadBalancing Mapper and View Classes', () => {
 
  29         it('mapStateToProps mapper exists', () => {
 
  30                 expect(mapStateToProps).toBeTruthy();
 
  33         it('mapStateToProps data test', () => {
 
  35                 const currentSoftwareProduct = VSPEditorFactory.build();
 
  38                         softwareProduct: SoftwareProductFactory.build({
 
  39                                 softwareProductEditor: {
 
  40                                         data: currentSoftwareProduct
 
  42                                 softwareProductComponents: {
 
  50                 var results = mapStateToProps(obj);
 
  51                 expect(results.qdata).toBeTruthy();
 
  55         it('VSP Components LoadBalancing view test', () => {
 
  57                 const currentSoftwareProduct = VSPEditorFactory.build();
 
  59                 const softwareProductComponents = {
 
  62                                 qschema: VSPQSchemaFactory.build()
 
  66                 const versionControllerData = VSPComponentsVersionControllerFactory.build();
 
  68                 var renderer = TestUtils.createRenderer();
 
  70                         <SoftwareProductComponentLoadBalancingView
 
  71                                 softwareProductComponents={softwareProductComponents}
 
  72                                 versionControllerData={versionControllerData}
 
  73                                 currentSoftwareProduct={currentSoftwareProduct}
 
  74                                 softwareProductId='123'
 
  76                 var renderedOutput = renderer.getRenderOutput();
 
  77                 expect(renderedOutput).toBeTruthy();