2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 import React from 'react';
24 import TestUtils from 'react-dom/lib/ReactTestUtils';
25 import {storeCreator} from 'app/AppStore.js';
26 import {Provider} from 'react-redux';
27 import { expect } from 'chai';
28 import VnfSearchOrchStatusVisualizations from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchOrchestratedStatusVisualization.jsx';
29 import VnfSearchProvStatusVisualizations from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchProvStatusVisualization.jsx';
30 import VnfSearchTotalCountVisualization from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchTotalCountVisualization.jsx';
34 TOTAL_VNF_COUNT} from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchVisualizationsConstants.js';
36 describe('VNF Visualizations Structure Tests', function () {
38 function createState(processedOrchStatusCountChartData,
39 processedProvStatusCountChartData) {
42 auditVisualizationsData: {
43 processedOrchStatusCountChartData: processedOrchStatusCountChartData,
44 processedProvStatusCountChartData: processedProvStatusCountChartData
50 it('VNF: Visualization layout VNF Orch Status, no data', function () {
51 const store = storeCreator(createState(
52 CHART_ORCH_STATUS.clearingEmptyData,
53 CHART_PROV_STATUS.clearingEmptyData
55 this.component = TestUtils.renderIntoDocument(
56 <Provider store={store}>
57 <VnfSearchOrchStatusVisualizations />
60 let visualizationContainer = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'visualizations');
61 expect(visualizationContainer).to.exist; // there is always a visualizations container
62 expect(visualizationContainer[0].className).to.contain('hidden'); // make sure visualizations is hidden
65 it('VNF: Visualization layout VNF Prov Status, no data', function () {
66 const store = storeCreator(createState(
67 CHART_ORCH_STATUS.clearingEmptyData,
68 CHART_PROV_STATUS.clearingEmptyData
70 this.component = TestUtils.renderIntoDocument(
71 <Provider store={store}>
72 <VnfSearchProvStatusVisualizations />
75 let visualizationContainer = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'visualizations');
76 expect(visualizationContainer).to.exist; // there is always a visualizations container
77 expect(visualizationContainer[0].className).to.contain('hidden'); // make sure visualizations is hidden
81 it('VNF: Visualization layout Total VNF, no data', function () {
82 const store = storeCreator(createState(
83 TOTAL_VNF_COUNT.clearingEmptyValue
85 this.component = TestUtils.renderIntoDocument(
86 <Provider store={store}>
87 <VnfSearchTotalCountVisualization />
90 let visualizationContainer = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'visualizations');
91 expect(visualizationContainer).to.exist; // there is always a visualizations container
92 expect(visualizationContainer[0].className).to.contain('hidden'); // make sure visualizations is hidden