2 * ============LICENSE_START=======================================================
3 * SPARKY (AAI UI service)
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 import React from 'react';
27 import TestUtils from 'react-dom/lib/ReactTestUtils';
28 import {storeCreator} from 'app/AppStore.js';
29 import {Provider} from 'react-redux';
30 import { expect } from 'chai';
31 import VnfSearchOrchStatusVisualizations from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchOrchestratedStatusVisualization.jsx';
32 import VnfSearchProvStatusVisualizations from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchProvStatusVisualization.jsx';
33 import VnfSearchTotalCountVisualization from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchTotalCountVisualization.jsx';
37 TOTAL_VNF_COUNT} from 'app/vnfSearch/vnfSearchVisualizations/VnfSearchVisualizationsConstants.js';
39 describe('VNF Visualizations Structure Tests', function () {
41 function createState(processedOrchStatusCountChartData,
42 processedProvStatusCountChartData) {
45 auditVisualizationsData: {
46 processedOrchStatusCountChartData: processedOrchStatusCountChartData,
47 processedProvStatusCountChartData: processedProvStatusCountChartData
53 it('VNF: Visualization layout VNF Orch Status, no data', function () {
54 const store = storeCreator(createState(
55 CHART_ORCH_STATUS.clearingEmptyData,
56 CHART_PROV_STATUS.clearingEmptyData
58 this.component = TestUtils.renderIntoDocument(
59 <Provider store={store}>
60 <VnfSearchOrchStatusVisualizations />
63 let visualizationContainer = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'visualizations');
64 expect(visualizationContainer).to.exist; // there is always a visualizations container
65 expect(visualizationContainer[0].className).to.contain('hidden'); // make sure visualizations is hidden
68 it('VNF: Visualization layout VNF Prov Status, no data', function () {
69 const store = storeCreator(createState(
70 CHART_ORCH_STATUS.clearingEmptyData,
71 CHART_PROV_STATUS.clearingEmptyData
73 this.component = TestUtils.renderIntoDocument(
74 <Provider store={store}>
75 <VnfSearchProvStatusVisualizations />
78 let visualizationContainer = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'visualizations');
79 expect(visualizationContainer).to.exist; // there is always a visualizations container
80 expect(visualizationContainer[0].className).to.contain('hidden'); // make sure visualizations is hidden
84 it('VNF: Visualization layout Total VNF, no data', function () {
85 const store = storeCreator(createState(
86 TOTAL_VNF_COUNT.clearingEmptyValue
88 this.component = TestUtils.renderIntoDocument(
89 <Provider store={store}>
90 <VnfSearchTotalCountVisualization />
93 let visualizationContainer = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'visualizations');
94 expect(visualizationContainer).to.exist; // there is always a visualizations container
95 expect(visualizationContainer[0].className).to.contain('hidden'); // make sure visualizations is hidden