2 * Copyright © 2019 Vodafone Group
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 { mapStateToProps } from 'sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResults.js';
19 import SoftwareProductValidationResultsView from 'sdc-app/onboarding/softwareProduct/validationResults/SoftwareProductValidationResultsView.jsx';
20 import { VSPTestResultsSuccessFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js';
21 import { VSPTestResultsFailureFactory } from 'test-utils/factories/softwareProduct/SoftwareProductValidationResultsFactory.js';
22 import TestUtils from 'react-dom/test-utils';
24 describe('SoftwareProductValidationResults Mapper and View Classes', () => {
25 it('mapStateToProps mapper exists', () => {
26 expect(mapStateToProps).toBeTruthy();
29 it('mapStateToProps fail data test', () => {
30 const vspTestResults = VSPTestResultsFailureFactory.build();
34 softwareProductValidation: {
35 vspTestResults: vspTestResults.vspTestResults
39 var results = mapStateToProps(obj);
40 expect(results.softwareProductValidation.vspTestResults).toBeTruthy();
43 it('mapStateToProps success data test', () => {
44 const vspTestResults = VSPTestResultsSuccessFactory.build();
48 softwareProductValidation: {
49 vspTestResults: vspTestResults.vspTestResults
53 var results = mapStateToProps(obj);
54 expect(results.softwareProductValidation.vspTestResults).toBeTruthy();
57 it('SoftwareProductValidationResultsView test fail render test', () => {
58 const vspTestResults = VSPTestResultsFailureFactory.build();
63 const softwareProductId = '1234';
65 softwareProductId: softwareProductId,
67 softwareProductValidation: {
68 vspTestResults: vspTestResults.vspTestResults
71 let vspValidationResultsView = TestUtils.renderIntoDocument(
72 <SoftwareProductValidationResultsView {...obj} />
74 expect(vspValidationResultsView).toBeTruthy();
77 it('SoftwareProductValidationResultsView test success render test', () => {
78 const vspTestResults = VSPTestResultsSuccessFactory.build();
83 const softwareProductId = '1234';
85 softwareProductId: softwareProductId,
87 softwareProductValidation: {
88 vspTestResults: vspTestResults.vspTestResults
91 let vspValidationResultsView = TestUtils.renderIntoDocument(
92 <SoftwareProductValidationResultsView {...obj} />
94 expect(vspValidationResultsView).toBeTruthy();