summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSteven Thomas <steve.thomas@amdocs.com>2018-09-13 16:22:40 -0400
committerSteven Thomas <steve.thomas@amdocs.com>2018-09-13 16:23:05 -0400
commit96319fec0d2af2be5802a56d6b05a3ada939c8df (patch)
tree630e87f62fbbebcded761bf3e67d0f3eb5b78598 /scripts
parentd1975c8134f0401b0ccebf3719eda129d53dac14 (diff)
increasing test coverage to 20 percent
Issue-ID: AAI-1599 Change-Id: I345e38d4319e52b56de0a33d7065e02617cc2103 Signed-off-by: Steven Thomas <steve.thomas@amdocs.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/build.sh35
-rw-r--r--scripts/test/fileMock.js1
-rw-r--r--scripts/test/setupTests.js5
-rw-r--r--scripts/test/styleMock.js1
4 files changed, 24 insertions, 18 deletions
diff --git a/scripts/build/build.sh b/scripts/build/build.sh
index 9fd9fd2..7af49cd 100644
--- a/scripts/build/build.sh
+++ b/scripts/build/build.sh
@@ -4,10 +4,10 @@
#
# UpdateFEwithExtensions
#
-# Description: Update files in the FE code based on the content of the
-# extensions. For this to work, extensions are required to fill
+# Description: Update files in the FE code based on the content of the
+# extensions. For this to work, extensions are required to fill
# some files. The current script does not care too much about
-# their locations (other than being in the component
+# their locations (other than being in the component
# nodes-modules) but the file name must match.
#
###############################################################################
@@ -39,7 +39,7 @@ UpdateFEwithExtensions(){
# Get extensible json additions
echo "build.sh --- Appending to resources/views/extensibleViews.json"
extConfig=`find node_modules/ -name "extensibleViews.json"`
- if [ ! -z "$extConfig" ]; then
+ if [ ! -z "$extConfig" ]; then
jq -n 'input | . +=[inputs]' resources/views/extensibleViews.json $extConfig > tmp
mv tmp resources/views/extensibleViews.json
fi
@@ -58,7 +58,7 @@ UpdateFEwithExtensions(){
# Get overlay json additions
echo "build.sh --- Appending to resources/overlays/overlaysDetails.json"
extConfig=`find node_modules/ -name "overlaysDetails.json"`
- if [ ! -z "$extConfig" ]; then
+ if [ ! -z "$extConfig" ]; then
jq -n 'input | . +=[inputs]' resources/overlays/overlaysDetails.json $extConfig > tmp
mv tmp resources/overlays/overlaysDetails.json
fi
@@ -67,11 +67,11 @@ UpdateFEwithExtensions(){
echo "build.sh --- Appending to resources/scss/customViews.scss"
touch resources/scss/customViews.scss
extSCSS=`find -name "extensibility.scss"`
- for i in $extSCSS; do
+ for i in $extSCSS; do
cat $i >> resources/scss/customViews.scss
done
-
-
+
+
}
updateStyle()
@@ -101,8 +101,8 @@ updateStyle()
if [ -f tmp.style.imports ]; then
sed -i /"import 'resources\/scss\/style\.scss';"/d src/app/main.app.jsx
fi
-
- # Update bootstrap
+
+ # Update bootstrap
echo "build.sh --- Update resources/scss/bootstrap.scss"
bootImports=`find extStyle/ -name "bootstrap.scss"`
for i in $bootImports; do
@@ -115,6 +115,19 @@ updateStyle()
fi
}
+UpdateFEWithCustomViews(){
+ # Append statements to src/app/configurableViews/index.js
+ echo "build.sh --- Appending to src/app/configurableViews/index.js"
+ custViewImports=`find -name "confViewIndex"`
+ for i in $custViewImports; do
+ cat $i | grep import > tmp.imports
+ cat $i | grep 'components\[' > tmp.components
+
+ sed -i '/Import section/ r tmp.imports' src/app/configurableViews/index.js
+ sed -i '/Components section/ r tmp.components' src/app/configurableViews/index.js
+ done
+}
+
###############################################################################
#
# Main
@@ -143,4 +156,4 @@ updateStyle
# npm run build
echo "build.sh --- Running npm run build"
-npm run build \ No newline at end of file
+npm run build
diff --git a/scripts/test/fileMock.js b/scripts/test/fileMock.js
deleted file mode 100644
index 86059f3..0000000
--- a/scripts/test/fileMock.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = 'test-file-stub';
diff --git a/scripts/test/setupTests.js b/scripts/test/setupTests.js
deleted file mode 100644
index 2318628..0000000
--- a/scripts/test/setupTests.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { configure } from 'enzyme';
-import Adapter from 'enzyme-adapter-react-16';
-import 'jest-enzyme';
-
-configure({ adapter: new Adapter() });
diff --git a/scripts/test/styleMock.js b/scripts/test/styleMock.js
deleted file mode 100644
index f053ebf..0000000
--- a/scripts/test/styleMock.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = {};