Refactoring test scripts 33/56233/2
authorArul.Nambi <arul.nambi@amdocs.com>
Wed, 11 Jul 2018 18:19:41 +0000 (14:19 -0400)
committerArul.Nambi <arul.nambi@amdocs.com>
Mon, 16 Jul 2018 14:04:10 +0000 (10:04 -0400)
Moving the test scripts under one folder and restucting them so that the
clutter can be avoided in the src folder.

Issue-ID: AAI-1371
Change-Id: I41b34acbe79a7a3409f2990f11492614f7ef9c5a
Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
16 files changed:
package.json
scripts/test/fileMock.js [moved from test/fileMock.js with 100% similarity]
scripts/test/setupTests.js [moved from test/setupTests.js with 100% similarity]
scripts/test/styleMock.js [moved from test/styleMock.js with 100% similarity]
test/tierSupport/SelectedNodeDetails.test.js [moved from src/app/tierSupport/selectedNodeDetails/SelectedNodeDetails.test.js with 94% similarity]
test/tierSupport/SelectedNodeDetailsReducer.test.js [moved from src/app/tierSupport/selectedNodeDetails/SelectedNodeDetailsReducer.test.js with 98% similarity]
test/utils/DateTimeChartUtil.test.js [moved from src/utils/DateTimeChartUtil.test.js with 99% similarity]
test/utils/SpinnerContainer.test.js [moved from src/utils/SpinnerContainer.test.js with 93% similarity]
test/vnfSearch/VnfSearch.test.js [moved from src/app/vnfSearch/VnfSearch.test.js with 92% similarity]
test/vnfSearch/VnfSearchActions.test.js [moved from src/app/vnfSearch/VnfSearchActions.test.js with 99% similarity]
test/vnfSearch/VnfSearchNfRoleVisualization.test.js [moved from src/app/vnfSearch/VnfSearchNfRoleVisualization.test.js with 96% similarity]
test/vnfSearch/VnfSearchNfTypeVisualization.test.js [moved from src/app/vnfSearch/VnfSearchNfTypeVisualization.test.js with 95% similarity]
test/vnfSearch/VnfSearchOrchestratedStatusVisualization.test.js [moved from src/app/vnfSearch/VnfSearchOrchestratedStatusVisualization.test.js with 95% similarity]
test/vnfSearch/VnfSearchProvStatusVisualization.test.js [moved from src/app/vnfSearch/VnfSearchProvStatusVisualization.test.js with 95% similarity]
test/vnfSearch/VnfSearchReducer.test.js [moved from src/app/vnfSearch/VnfSearchReducer.test.js with 98% similarity]
test/vnfSearch/VnfSearchTotalCountVisualization.test.js [moved from src/app/vnfSearch/VnfSearchTotalCountVisualization.test.js with 94% similarity]

index 55e7652..8401a11 100644 (file)
   },
   "jest": {
     "verbose": true,
-    "setupTestFrameworkScriptFile": "./test/setupTests.js",
+    "setupTestFrameworkScriptFile": "./scripts/test/setupTests.js",
     "automock": false,
     "moduleNameMapper": {
-      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/fileMock.js",
-      "\\.(css|scss)$": "<rootDir>/test/styleMock.js"
+      "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/scripts/test/fileMock.js",
+      "\\.(css|scss)$": "<rootDir>/scripts/test/styleMock.js"
     },
     "moduleFileExtensions": [
       "js",
similarity index 100%
rename from test/fileMock.js
rename to scripts/test/fileMock.js
similarity index 100%
rename from test/styleMock.js
rename to scripts/test/styleMock.js
@@ -4,9 +4,9 @@ import {Provider} from 'react-redux'
 import configureStore from 'redux-mock-store';
 import Table from 'react-bootstrap/lib/Table';
 
-import ConnectedSelectedNodeDetails, { SelectedNodeDetails } from './SelectedNodeDetails.jsx';
-import { SELECTED_NODE_TABLE_COLUMN_NAMES } from './SelectedNodeDetailsConstants.js';
-import LaunchInContext from '../launchExternalResource/LaunchExternalResource.jsx';
+import ConnectedSelectedNodeDetails, { SelectedNodeDetails } from 'app/tierSupport/selectedNodeDetails/SelectedNodeDetails.jsx';
+import { SELECTED_NODE_TABLE_COLUMN_NAMES } from 'app/tierSupport/selectedNodeDetails/SelectedNodeDetailsConstants.js';
+import LaunchInContext from 'app/tierSupport/launchExternalResource/LaunchExternalResource.jsx';
 
 describe('SelectedNodeDetails - Shallow render of component', () => {
   let wrapper;
@@ -1,4 +1,4 @@
-import SelectedNodeDetailsReducer from './SelectedNodeDetailsReducer.js';
+import SelectedNodeDetailsReducer from 'app/tierSupport/selectedNodeDetails/SelectedNodeDetailsReducer.js';
 import {tierSupportActionTypes} from 'app/tierSupport/TierSupportConstants.js';
 import {
   globalAutoCompleteSearchBarActionTypes
similarity index 99%
rename from src/utils/DateTimeChartUtil.test.js
rename to test/utils/DateTimeChartUtil.test.js
index b1e9d69..3f7be00 100644 (file)
@@ -4,7 +4,7 @@ import {
   dateFormatLocalTimeZoneYYYYMMDD,
   getTicks,
   getTicksData
-} from './DateTimeChartUtil.js';
+} from 'utils/DateTimeChartUtil.js';
 
 describe('DateTimeChartUtil Tests', () => {
   it('sortDataByField', () => {
similarity index 93%
rename from src/utils/SpinnerContainer.test.js
rename to test/utils/SpinnerContainer.test.js
index a217b8a..088ad2a 100644 (file)
@@ -2,8 +2,8 @@ import React from 'react';
 import { ClipLoader } from 'react-spinners';
 import { mount } from 'enzyme';
 
-import SpinnerContainer from './SpinnerContainer.jsx';
-import {COLOR_BLUE} from 'utils/GlobalConstants.js';
+import SpinnerContainer from 'utils/SpinnerContainer.jsx';
+import {COLOR_BLUE} from 'utils/GlobalConstants';
 
 describe('SpinnerContainer', () => {
   it('render spinner - visible', () => {
similarity index 92%
rename from src/app/vnfSearch/VnfSearch.test.js
rename to test/vnfSearch/VnfSearch.test.js
index c6c63fc..3875543 100644 (file)
@@ -1,9 +1,9 @@
 import React from 'react';
 import { shallow, mount } from 'enzyme';
-import {Provider} from 'react-redux'
+import {Provider} from 'react-redux';
 import configureStore from 'redux-mock-store';
 
-import ConnectedVnfSearch, { vnfSearch } from './VnfSearch.jsx';
+import ConnectedVnfSearch, { vnfSearch } from 'app/vnfSearch/VnfSearch.jsx';
 
 describe('VnfSearch - Shallow render of component', () => {
   let wrapper;
similarity index 99%
rename from src/app/vnfSearch/VnfSearchActions.test.js
rename to test/vnfSearch/VnfSearchActions.test.js
index 927e6ab..e1c3733 100644 (file)
@@ -7,7 +7,7 @@ import {
   clearVnfSearchData,
   setNotificationText,
   processVnfVisualizationsOnFilterChange
-} from './VnfSearchActions.js';
+} from 'app/vnfSearch/VnfSearchActions.js';
 import {
   vnfActionTypes,
   CHART_PROV_STATUS,
@@ -5,8 +5,8 @@ import configureStore from 'redux-mock-store';
 import { BarChart } from 'recharts';
 
 import ConnectedVnfSearchNfRoleVisualization,
-  { VnfSearchNfRoleVisualization } from './VnfSearchNfRoleVisualization.jsx';
-import { CHART_NF_ROLE } from './VnfSearchConstants.js';
+  { VnfSearchNfRoleVisualization } from 'app/vnfSearch/VnfSearchNfRoleVisualization.jsx';
+import { CHART_NF_ROLE } from 'app/vnfSearch/VnfSearchConstants.js';
 import Spinner from 'utils/SpinnerContainer.jsx';
 
 describe('VnfSearchNfRoleVisualization - Shallow render of component', () => {
@@ -5,9 +5,9 @@ import configureStore from 'redux-mock-store';
 import { BarChart } from 'recharts';
 
 import ConnectedVnfSearchNfTypeVisualization,
-  { VnfSearchNfTypeVisualization } from './VnfSearchNfTypeVisualization.jsx';
-import { CHART_NF_TYPE } from './VnfSearchConstants.js';
-import Spinner from 'utils/SpinnerContainer.jsx';
+  { VnfSearchNfTypeVisualization } from 'app/vnfSearch/VnfSearchNfTypeVisualization.jsx';
+import { CHART_NF_TYPE } from 'app/vnfSearch/VnfSearchConstants.js';
+import Spinner from 'utils/SpinnerContainer';
 
 describe('VnfSearchNfTypeVisualization - Shallow render of component', () => {
   let wrapper;
@@ -5,9 +5,9 @@ import configureStore from 'redux-mock-store';
 import { BarChart } from 'recharts';
 
 import ConnectedVnfSearchOrchStatusVisualizations,
-  { VnfSearchOrchStatusVisualizations } from './VnfSearchOrchestratedStatusVisualization.jsx';
-import { CHART_ORCH_STATUS } from './VnfSearchConstants.js';
-import Spinner from 'utils/SpinnerContainer.jsx';
+  { VnfSearchOrchStatusVisualizations } from 'app/vnfSearch/VnfSearchOrchestratedStatusVisualization.jsx';
+import { CHART_ORCH_STATUS } from 'app/vnfSearch/VnfSearchConstants.js';
+import Spinner from 'utils/SpinnerContainer';
 
 describe('VnfSearchOrchStatusVisualizations - Shallow render of component', () => {
   let wrapper;
@@ -5,9 +5,9 @@ import configureStore from 'redux-mock-store';
 import { BarChart } from 'recharts';
 
 import ConnectedVnfSearchProvStatusVisualization,
-  { VnfSearchProvStatusVisualization } from './VnfSearchProvStatusVisualization.jsx';
-import { CHART_PROV_STATUS } from './VnfSearchConstants.js';
-import Spinner from 'utils/SpinnerContainer.jsx';
+  { VnfSearchProvStatusVisualization } from 'app/vnfSearch/VnfSearchProvStatusVisualization.jsx';
+import { CHART_PROV_STATUS } from 'app/vnfSearch/VnfSearchConstants.js';
+import Spinner from 'utils/SpinnerContainer';
 
 describe('VnfSearchProvStatusVisualization - Shallow render of component', () => {
   let wrapper;
similarity index 98%
rename from src/app/vnfSearch/VnfSearchReducer.test.js
rename to test/vnfSearch/VnfSearchReducer.test.js
index ff06770..381a696 100644 (file)
@@ -1,4 +1,4 @@
-import VnfSearchReducer from './VnfSearchReducer.js';
+import VnfSearchReducer from 'app/vnfSearch/VnfSearchReducer.js';
 import {
   vnfActionTypes,
   CHART_ORCH_STATUS,
@@ -6,12 +6,12 @@ import {
   CHART_NF_ROLE,
   CHART_NF_TYPE,
   TOTAL_VNF_COUNT
-} from './VnfSearchConstants.js';
+} from 'app/vnfSearch/VnfSearchConstants.js';
 import {ERROR_RETRIEVING_DATA} from 'app/networking/NetworkConstants.js';
 import {
   filterBarActionTypes,
   MESSAGE_LEVEL_DANGER
-} from 'utils/GlobalConstants.js';
+} from 'utils/GlobalConstants';
 import {
   globalAutoCompleteSearchBarActionTypes
 } from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBarConstants.js';
@@ -4,9 +4,9 @@ import {Provider} from 'react-redux'
 import configureStore from 'redux-mock-store';
 
 import ConnectedVnfSearchTotalCountVisualization,
-  { VnfSearchTotalCountVisualization } from './VnfSearchTotalCountVisualization.jsx';
-import { TOTAL_VNF_COUNT } from './VnfSearchConstants.js';
-import Spinner from 'utils/SpinnerContainer.jsx';
+  { VnfSearchTotalCountVisualization } from 'app/vnfSearch/VnfSearchTotalCountVisualization.jsx';
+import { TOTAL_VNF_COUNT } from 'app/vnfSearch/VnfSearchConstants.js';
+import Spinner from 'utils/SpinnerContainer';
 
 describe('VnfSearchTotalCountVisualization - Shallow render of component', () => {
   let wrapper;

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use