From dd61d7fa04efde66d9d121864f039123faccc9ae Mon Sep 17 00:00:00 2001 From: Julian Jacobs Date: Sun, 24 May 2020 15:37:14 +0200 Subject: [PATCH] unit testing and code coverage reports --- demo/ionic-dev/coverage/base.css | 224 ++++++++ demo/ionic-dev/coverage/block-navigation.js | 79 +++ demo/ionic-dev/coverage/index.html | 305 +++++++++++ demo/ionic-dev/coverage/lcov.info | 493 ++++++++++++++++++ demo/ionic-dev/coverage/prettify.css | 1 + demo/ionic-dev/coverage/prettify.js | 2 + demo/ionic-dev/coverage/sort-arrow-sprite.png | Bin 0 -> 209 bytes demo/ionic-dev/coverage/sorter.js | 170 ++++++ .../src/app/app-routing.module.ts.html | 151 ++++++ .../coverage/src/app/app.component.ts.html | 160 ++++++ .../src/app/components/logo/index.html | 110 ++++ .../components/logo/logo.component.ts.html | 121 +++++ .../src/app/config/auth-constants.ts.html | 85 +++ .../coverage/src/app/config/index.html | 110 ++++ .../src/app/guards/home.guard.ts.html | 160 ++++++ .../src/app/guards/index.guard.ts.html | 160 ++++++ .../coverage/src/app/guards/index.html | 125 +++++ .../src/app/home/home-routing.module.ts.html | 226 ++++++++ .../coverage/src/app/home/home.module.ts.html | 139 +++++ .../coverage/src/app/home/home.page.ts.html | 124 +++++ .../coverage/src/app/home/index.html | 140 +++++ demo/ionic-dev/coverage/src/app/index.html | 125 +++++ .../coverage/src/app/index/index.html | 110 ++++ .../coverage/src/app/index/index.page.ts.html | 124 +++++ .../course-management.page.ts.html | 124 +++++ .../app/pages/course-management/index.html | 110 ++++ .../dashboard-routing.module.ts.html | 130 +++++ .../pages/dashboard/dashboard.module.ts.html | 139 +++++ .../pages/dashboard/dashboard.page.ts.html | 139 +++++ .../src/app/pages/dashboard/index.html | 140 +++++ .../src/app/pages/settings/index.html | 110 ++++ .../app/pages/settings/settings.page.ts.html | 136 +++++ .../coverage/src/app/pages/signin/index.html | 110 ++++ .../src/app/pages/signin/signin.page.ts.html | 289 ++++++++++ .../coverage/src/app/resolvers/index.html | 110 ++++ .../app/resolvers/userData.resolver.ts.html | 124 +++++ .../src/app/services/auth.service.ts.html | 193 +++++++ .../src/app/services/http.service.ts.html | 136 +++++ .../coverage/src/app/services/index.html | 155 ++++++ .../src/app/services/storage.service.ts.html | 193 +++++++ .../src/app/services/toast.service.ts.html | 133 +++++ .../src/environments/environment.ts.html | 130 +++++ .../coverage/src/environments/index.html | 110 ++++ demo/ionic-dev/coverage/src/index.html | 140 +++++ demo/ionic-dev/coverage/src/polyfills.ts.html | 277 ++++++++++ demo/ionic-dev/coverage/src/test.ts.html | 139 +++++ .../ionic-dev/coverage/src/zone-flags.ts.html | 94 ++++ demo/ionic-dev/greenpeace/package-lock.json | 376 +++++++++++-- demo/ionic-dev/greenpeace/package.json | 6 +- .../components/logo/logo.component.spec.ts | 35 +- .../explore-container.component.html | 4 - .../explore-container.component.scss | 27 - .../explore-container.component.spec.ts | 24 - .../explore-container.component.ts | 15 - .../explore-container.module.ts | 14 - .../src/app/guards/home.guard.spec.ts | 99 +++- .../src/app/guards/index.guard.spec.ts | 55 +- .../src/app/home/home-routing.module.ts | 2 +- .../greenpeace/src/app/home/home.page.html | 2 +- .../greenpeace/src/app/home/home.page.spec.ts | 140 ++++- .../src/app/index/index.page.spec.ts | 10 +- .../course-management.page.html | 4 - .../course-management.page.spec.ts | 24 +- .../pages/dashboard/dashboard.page.spec.ts | 73 ++- .../app/pages/settings/settings.page.spec.ts | 68 ++- .../src/app/pages/signin/signin.page.html | 2 +- .../src/app/pages/signin/signin.page.spec.ts | 336 +++++++++++- .../src/app/pages/signin/signin.page.ts | 4 +- 68 files changed, 7986 insertions(+), 139 deletions(-) create mode 100644 demo/ionic-dev/coverage/base.css create mode 100644 demo/ionic-dev/coverage/block-navigation.js create mode 100644 demo/ionic-dev/coverage/index.html create mode 100644 demo/ionic-dev/coverage/lcov.info create mode 100644 demo/ionic-dev/coverage/prettify.css create mode 100644 demo/ionic-dev/coverage/prettify.js create mode 100644 demo/ionic-dev/coverage/sort-arrow-sprite.png create mode 100644 demo/ionic-dev/coverage/sorter.js create mode 100644 demo/ionic-dev/coverage/src/app/app-routing.module.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/app.component.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/components/logo/index.html create mode 100644 demo/ionic-dev/coverage/src/app/components/logo/logo.component.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/config/auth-constants.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/config/index.html create mode 100644 demo/ionic-dev/coverage/src/app/guards/home.guard.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/guards/index.guard.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/guards/index.html create mode 100644 demo/ionic-dev/coverage/src/app/home/home-routing.module.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/home/home.module.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/home/home.page.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/home/index.html create mode 100644 demo/ionic-dev/coverage/src/app/index.html create mode 100644 demo/ionic-dev/coverage/src/app/index/index.html create mode 100644 demo/ionic-dev/coverage/src/app/index/index.page.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/course-management/course-management.page.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/course-management/index.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard-routing.module.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.module.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.page.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/dashboard/index.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/settings/index.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/settings/settings.page.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/signin/index.html create mode 100644 demo/ionic-dev/coverage/src/app/pages/signin/signin.page.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/resolvers/index.html create mode 100644 demo/ionic-dev/coverage/src/app/resolvers/userData.resolver.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/services/auth.service.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/services/http.service.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/services/index.html create mode 100644 demo/ionic-dev/coverage/src/app/services/storage.service.ts.html create mode 100644 demo/ionic-dev/coverage/src/app/services/toast.service.ts.html create mode 100644 demo/ionic-dev/coverage/src/environments/environment.ts.html create mode 100644 demo/ionic-dev/coverage/src/environments/index.html create mode 100644 demo/ionic-dev/coverage/src/index.html create mode 100644 demo/ionic-dev/coverage/src/polyfills.ts.html create mode 100644 demo/ionic-dev/coverage/src/test.ts.html create mode 100644 demo/ionic-dev/coverage/src/zone-flags.ts.html delete mode 100644 demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.html delete mode 100644 demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.scss delete mode 100644 demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.spec.ts delete mode 100644 demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.ts delete mode 100644 demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.module.ts diff --git a/demo/ionic-dev/coverage/base.css b/demo/ionic-dev/coverage/base.css new file mode 100644 index 0000000..f418035 --- /dev/null +++ b/demo/ionic-dev/coverage/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/demo/ionic-dev/coverage/block-navigation.js b/demo/ionic-dev/coverage/block-navigation.js new file mode 100644 index 0000000..c7ff5a5 --- /dev/null +++ b/demo/ionic-dev/coverage/block-navigation.js @@ -0,0 +1,79 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/demo/ionic-dev/coverage/index.html b/demo/ionic-dev/coverage/index.html new file mode 100644 index 0000000..bbd0fa7 --- /dev/null +++ b/demo/ionic-dev/coverage/index.html @@ -0,0 +1,305 @@ + + + + + + Code coverage report for All files + + + + + + + + +
+
+

All files

+
+ +
+ 77.62% + Statements + 111/143 +
+ + +
+ 95.45% + Branches + 21/22 +
+ + +
+ 59.38% + Functions + 38/64 +
+ + +
+ 75.42% + Lines + 89/118 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
src +
+
100%4/4100%0/0100%0/0100%4/4
src/app +
+
66.67%12/18100%0/033.33%3/976.92%10/13
src/app/components/logo +
+
100%2/2100%0/0100%2/2100%1/1
src/app/config +
+
100%1/1100%0/0100%0/0100%1/1
src/app/guards +
+
90.91%20/22100%4/480%8/1088.89%16/18
src/app/home +
+
60%9/15100%0/040%4/1050%6/12
src/app/index +
+
100%2/2100%0/0100%2/2100%1/1
src/app/pages/course-management +
+
100%2/2100%0/0100%2/2100%1/1
src/app/pages/dashboard +
+
100%10/10100%0/0100%3/3100%7/7
src/app/pages/settings +
+
75%3/4100%0/066.67%2/366.67%2/3
src/app/pages/signin +
+
100%23/23100%16/16100%6/6100%22/22
src/app/resolvers +
+
50%2/4100%0/00%0/233.33%1/3
src/app/services +
+
57.14%20/3550%1/240%6/1551.61%16/31
src/environments +
+
100%1/1100%0/0100%0/0100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/lcov.info b/demo/ionic-dev/coverage/lcov.info new file mode 100644 index 0000000..d9e19e9 --- /dev/null +++ b/demo/ionic-dev/coverage/lcov.info @@ -0,0 +1,493 @@ +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\polyfills.ts +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\test.ts +FNF:0 +FNH:0 +DA:13,1 +DA:18,1 +DA:20,1 +LF:3 +LH:3 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\zone-flags.ts +FNF:0 +FNH:0 +DA:5,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\app-routing.module.ts +FN:7,(anonymous_0) +FN:7,(anonymous_1) +FN:11,(anonymous_2) +FN:11,(anonymous_3) +FN:15,(anonymous_4) +FN:15,(anonymous_5) +FNF:6 +FNH:0 +FNDA:0,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +DA:4,1 +DA:7,0 +DA:11,0 +DA:15,0 +DA:24,1 +LF:5 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\app.component.ts +FN:13,(anonymous_0) +FN:21,(anonymous_1) +FN:22,(anonymous_2) +FNF:3 +FNH:3 +FNDA:2,(anonymous_0) +FNDA:2,(anonymous_1) +FNDA:2,(anonymous_2) +DA:12,1 +DA:14,2 +DA:15,2 +DA:16,2 +DA:18,2 +DA:22,2 +DA:23,2 +DA:24,2 +LF:8 +LH:8 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\components\logo\logo.component.ts +FN:10,(anonymous_0) +FN:12,(anonymous_1) +FNF:2 +FNH:2 +FNDA:6,(anonymous_0) +FNDA:6,(anonymous_1) +DA:8,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\config\auth-constants.ts +FNF:0 +FNH:0 +DA:2,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\guards\home.guard.ts +FN:26,(anonymous_0) +FN:10,(anonymous_1) +FN:11,(anonymous_2) +FN:12,(anonymous_3) +FN:20,(anonymous_4) +FNF:5 +FNH:4 +FNDA:6,(anonymous_0) +FNDA:4,(anonymous_1) +FNDA:4,(anonymous_2) +FNDA:4,(anonymous_3) +FNDA:0,(anonymous_4) +DA:9,1 +DA:11,4 +DA:12,4 +DA:13,4 +DA:14,1 +DA:17,3 +DA:18,3 +DA:21,0 +DA:26,6 +LF:9 +LH:8 +BRDA:13,0,0,1 +BRDA:13,0,1,3 +BRF:2 +BRH:2 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\guards\index.guard.ts +FN:26,(anonymous_0) +FN:10,(anonymous_1) +FN:11,(anonymous_2) +FN:12,(anonymous_3) +FN:20,(anonymous_4) +FNF:5 +FNH:4 +FNDA:4,(anonymous_0) +FNDA:2,(anonymous_1) +FNDA:2,(anonymous_2) +FNDA:2,(anonymous_3) +FNDA:0,(anonymous_4) +DA:9,1 +DA:11,2 +DA:12,2 +DA:13,2 +DA:14,1 +DA:15,1 +DA:18,1 +DA:21,0 +DA:26,4 +LF:9 +LH:8 +BRDA:13,0,0,1 +BRDA:13,0,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\home\home-routing.module.ts +FN:19,(anonymous_0) +FN:20,(anonymous_1) +FN:25,(anonymous_2) +FN:26,(anonymous_3) +FN:31,(anonymous_4) +FN:32,(anonymous_5) +FN:37,(anonymous_6) +FN:38,(anonymous_7) +FNF:8 +FNH:2 +FNDA:0,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:4,(anonymous_2) +FNDA:4,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_6) +FNDA:0,(anonymous_7) +DA:8,1 +DA:19,0 +DA:20,0 +DA:25,4 +DA:26,4 +DA:31,0 +DA:32,0 +DA:37,0 +DA:38,0 +DA:49,1 +LF:10 +LH:4 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\home\home.module.ts +FNF:0 +FNH:0 +DA:20,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\home\home.page.ts +FN:10,(anonymous_0) +FN:12,(anonymous_1) +FNF:2 +FNH:2 +FNDA:31,(anonymous_0) +FNDA:31,(anonymous_1) +DA:8,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\index\index.page.ts +FN:10,(anonymous_0) +FN:12,(anonymous_1) +FNF:2 +FNH:2 +FNDA:3,(anonymous_0) +FNDA:3,(anonymous_1) +DA:8,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\pages\course-management\course-management.page.ts +FN:10,(anonymous_0) +FN:12,(anonymous_1) +FNF:2 +FNH:2 +FNDA:5,(anonymous_0) +FNDA:5,(anonymous_1) +DA:8,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\pages\dashboard\dashboard-routing.module.ts +FNF:0 +FNH:0 +DA:6,1 +DA:17,1 +LF:2 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\pages\dashboard\dashboard.module.ts +FNF:0 +FNH:0 +DA:20,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\pages\dashboard\dashboard.page.ts +FN:12,(anonymous_0) +FN:14,(anonymous_1) +FN:15,(anonymous_2) +FNF:3 +FNH:3 +FNDA:14,(anonymous_0) +FNDA:16,(anonymous_1) +FNDA:16,(anonymous_2) +DA:9,1 +DA:12,14 +DA:15,16 +DA:16,16 +LF:4 +LH:4 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\pages\settings\settings.page.ts +FN:11,(anonymous_0) +FN:13,(anonymous_1) +FN:16,(anonymous_2) +FNF:3 +FNH:2 +FNDA:14,(anonymous_0) +FNDA:14,(anonymous_1) +FNDA:0,(anonymous_2) +DA:9,1 +DA:11,14 +DA:17,0 +LF:3 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\pages\signin\signin.page.ts +FN:19,(anonymous_0) +FN:26,(anonymous_1) +FN:29,(anonymous_2) +FN:40,(anonymous_3) +FN:43,(anonymous_4) +FN:52,(anonymous_5) +FNF:6 +FNH:6 +FNDA:64,(anonymous_0) +FNDA:64,(anonymous_1) +FNDA:4,(anonymous_2) +FNDA:9,(anonymous_3) +FNDA:4,(anonymous_4) +FNDA:1,(anonymous_5) +DA:13,1 +DA:14,64 +DA:20,64 +DA:21,64 +DA:22,64 +DA:23,64 +DA:30,4 +DA:31,4 +DA:33,4 +DA:41,9 +DA:42,5 +DA:44,4 +DA:45,3 +DA:46,3 +DA:49,1 +DA:53,1 +DA:57,4 +DA:58,2 +DA:61,2 +DA:62,1 +DA:64,2 +DA:65,1 +LF:22 +LH:22 +BRDA:34,0,0,4 +BRDA:34,0,1,2 +BRDA:34,0,2,1 +BRDA:34,0,3,1 +BRDA:41,1,0,5 +BRDA:41,1,1,4 +BRDA:44,2,0,3 +BRDA:44,2,1,1 +BRDA:57,3,0,2 +BRDA:57,3,1,2 +BRDA:57,4,0,4 +BRDA:57,4,1,3 +BRDA:61,5,0,1 +BRDA:61,5,1,1 +BRDA:64,6,0,1 +BRDA:64,6,1,1 +BRF:16 +BRH:16 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\resolvers\userData.resolver.ts +FN:11,(anonymous_0) +FN:13,(anonymous_1) +FNF:2 +FNH:0 +FNDA:0,(anonymous_0) +FNDA:0,(anonymous_1) +DA:8,1 +DA:11,0 +DA:14,0 +LF:3 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\services\auth.service.ts +FN:16,(anonymous_0) +FN:22,(anonymous_1) +FN:23,(anonymous_2) +FN:28,(anonymous_3) +FN:32,(anonymous_4) +FN:33,(anonymous_5) +FNF:6 +FNH:1 +FNDA:93,(anonymous_0) +FNDA:0,(anonymous_1) +FNDA:0,(anonymous_2) +FNDA:0,(anonymous_3) +FNDA:0,(anonymous_4) +FNDA:0,(anonymous_5) +DA:13,1 +DA:14,93 +DA:17,93 +DA:18,93 +DA:19,93 +DA:23,0 +DA:24,0 +DA:29,0 +DA:33,0 +DA:34,0 +DA:35,0 +LF:11 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\services\http.service.ts +FN:10,(anonymous_0) +FN:12,(anonymous_1) +FNF:2 +FNH:1 +FNDA:95,(anonymous_0) +FNDA:0,(anonymous_1) +DA:8,1 +DA:10,95 +DA:13,0 +DA:14,0 +DA:16,0 +DA:17,0 +LF:6 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\services\storage.service.ts +FN:11,(anonymous_0) +FN:13,(anonymous_1) +FN:21,(anonymous_3) +FN:31,(anonymous_5) +FN:35,(anonymous_7) +FNF:5 +FNH:3 +FNDA:104,(anonymous_0) +FNDA:2,(anonymous_1) +FNDA:2,(anonymous_3) +FNDA:0,(anonymous_5) +FNDA:0,(anonymous_7) +DA:4,1 +DA:9,1 +DA:14,2 +DA:15,2 +DA:22,2 +DA:23,2 +DA:24,2 +DA:27,0 +DA:32,0 +DA:36,0 +LF:10 +LH:7 +BRDA:23,0,0,2 +BRDA:23,0,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\app\services\toast.service.ts +FN:9,(anonymous_0) +FN:11,(anonymous_1) +FNF:2 +FNH:1 +FNDA:65,(anonymous_0) +FNDA:0,(anonymous_1) +DA:7,1 +DA:9,65 +DA:12,0 +DA:16,0 +LF:4 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:C:\Users\Julian Jacobs\Documents\GitHub\greenpeace\demo\ionic-dev\greenpeace\src\environments\environment.ts +FNF:0 +FNH:0 +DA:5,1 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record diff --git a/demo/ionic-dev/coverage/prettify.css b/demo/ionic-dev/coverage/prettify.css new file mode 100644 index 0000000..b317a7c --- /dev/null +++ b/demo/ionic-dev/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/demo/ionic-dev/coverage/prettify.js b/demo/ionic-dev/coverage/prettify.js new file mode 100644 index 0000000..b322523 --- /dev/null +++ b/demo/ionic-dev/coverage/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/demo/ionic-dev/coverage/sort-arrow-sprite.png b/demo/ionic-dev/coverage/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..03f704a609c6fd0dbfdac63466a7d7c958b5cbf3 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function(a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function(a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc + ? ' sorted-desc' + : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function() { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i = 0; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function() { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/demo/ionic-dev/coverage/src/app/app-routing.module.ts.html b/demo/ionic-dev/coverage/src/app/app-routing.module.ts.html new file mode 100644 index 0000000..b46fa2a --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/app-routing.module.ts.html @@ -0,0 +1,151 @@ + + + + + + Code coverage report for src/app/app-routing.module.ts + + + + + + + + +
+
+

All files / src/app app-routing.module.ts

+
+ +
+ 33.33% + Statements + 3/9 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/6 +
+ + +
+ 40% + Lines + 2/5 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x + 
import { NgModule } from '@angular/core';
+import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
+ 
+const routes: Routes = [
+  {
+    path: '',
+    loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule)
+  },
+  {
+    path: 'home',
+    loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
+  },
+  {
+    path: 'settings',
+    loadChildren: () => import('./pages/settings/settings.module').then( m => m.SettingsPageModule)
+  }
+];
+@NgModule({
+  imports: [
+    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
+  ],
+  exports: [RouterModule]
+})
+export class AppRoutingModule {}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/app.component.ts.html b/demo/ionic-dev/coverage/src/app/app.component.ts.html new file mode 100644 index 0000000..3dd195a --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/app.component.ts.html @@ -0,0 +1,160 @@ + + + + + + Code coverage report for src/app/app.component.ts + + + + + + + + +
+
+

All files / src/app app.component.ts

+
+ +
+ 100% + Statements + 9/9 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 3/3 +
+ + +
+ 100% + Lines + 8/8 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +  +  +  +  +  +  +  +  +  +1x +  +2x +2x +2x +  +2x +  +  +  +2x +2x +2x +  +  +  + 
import { Component } from '@angular/core';
+ 
+import { Platform } from '@ionic/angular';
+import { SplashScreen } from '@ionic-native/splash-screen/ngx';
+import { StatusBar } from '@ionic-native/status-bar/ngx';
+ 
+@Component({
+  selector: 'app-root',
+  templateUrl: 'app.component.html',
+  styleUrls: ['app.component.scss']
+})
+export class AppComponent {
+  constructor(
+    private platform: Platform,
+    private splashScreen: SplashScreen,
+    private statusBar: StatusBar
+  ) {
+    this.initializeApp();
+  }
+ 
+  initializeApp() {
+    this.platform.ready().then(() => {
+      this.statusBar.styleDefault();
+      this.splashScreen.hide();
+    });
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/components/logo/index.html b/demo/ionic-dev/coverage/src/app/components/logo/index.html new file mode 100644 index 0000000..6c91d98 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/components/logo/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/components/logo + + + + + + + + +
+
+

All files src/app/components/logo

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
logo.component.ts +
+
100%2/2100%0/0100%2/2100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/components/logo/logo.component.ts.html b/demo/ionic-dev/coverage/src/app/components/logo/logo.component.ts.html new file mode 100644 index 0000000..91664cb --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/components/logo/logo.component.ts.html @@ -0,0 +1,121 @@ + + + + + + Code coverage report for src/app/components/logo/logo.component.ts + + + + + + + + +
+
+

All files / src/app/components/logo logo.component.ts

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15  +  +  +  +  +  +  +1x +  +  +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+ 
+@Component({
+  selector: 'app-logo',
+  templateUrl: './logo.component.html',
+  styleUrls: ['./logo.component.scss'],
+})
+export class LogoComponent implements OnInit {
+ 
+  constructor() { }
+ 
+  ngOnInit() {}
+ 
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/config/auth-constants.ts.html b/demo/ionic-dev/coverage/src/app/config/auth-constants.ts.html new file mode 100644 index 0000000..17fc4c1 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/config/auth-constants.ts.html @@ -0,0 +1,85 @@ + + + + + + Code coverage report for src/app/config/auth-constants.ts + + + + + + + + +
+
+

All files / src/app/config auth-constants.ts

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3  +1x + 
export class  AuthConstants {
+    public static readonly AUTH = 'userDataKey'
+}
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/config/index.html b/demo/ionic-dev/coverage/src/app/config/index.html new file mode 100644 index 0000000..7063955 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/config/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/config + + + + + + + + +
+
+

All files src/app/config

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
auth-constants.ts +
+
100%1/1100%0/0100%0/0100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/guards/home.guard.ts.html b/demo/ionic-dev/coverage/src/app/guards/home.guard.ts.html new file mode 100644 index 0000000..83e6f9b --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/guards/home.guard.ts.html @@ -0,0 +1,160 @@ + + + + + + Code coverage report for src/app/guards/home.guard.ts + + + + + + + + +
+
+

All files / src/app/guards home.guard.ts

+
+ +
+ 90.91% + Statements + 10/11 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 80% + Functions + 4/5 +
+ + +
+ 88.89% + Lines + 8/9 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +  +  +  +  +  +  +1x +  +4x +4x +4x +1x +  +  +3x +3x +  +  +  +  +  +  +  +6x +  + 
import { Injectable } from '@angular/core';
+import { CanActivate, Router } from '@angular/router';
+import { StorageService } from '../services/storage.service';
+import { AuthConstants } from '../config/auth-constants';
+ 
+@Injectable({
+  providedIn: 'root'
+})
+export class HomeGuard implements CanActivate {
+  canActivate(): Promise<boolean> {
+    return new Promise(resolve => {
+      this.storageService.get(AuthConstants.AUTH).then( res => {
+        if (res) {
+          resolve(true);
+        }
+        else {
+          this.router.navigate(['signin']);
+          resolve(false);
+        }
+      }).catch(err => {
+        resolve(false);
+      });
+    });
+  }
+ 
+  constructor(public storageService: StorageService, private router: Router) { }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/guards/index.guard.ts.html b/demo/ionic-dev/coverage/src/app/guards/index.guard.ts.html new file mode 100644 index 0000000..6b9d237 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/guards/index.guard.ts.html @@ -0,0 +1,160 @@ + + + + + + Code coverage report for src/app/guards/index.guard.ts + + + + + + + + +
+
+

All files / src/app/guards index.guard.ts

+
+ +
+ 90.91% + Statements + 10/11 +
+ + +
+ 100% + Branches + 2/2 +
+ + +
+ 80% + Functions + 4/5 +
+ + +
+ 88.89% + Lines + 8/9 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +  +  +  +  +  +  +1x +  +2x +2x +2x +1x +1x +  +  +1x +  +  +  +  +  +  +  +4x +  + 
import { Injectable } from '@angular/core';
+import { CanActivate, Router } from '@angular/router';
+import { AuthConstants } from '../config/auth-constants';
+import { StorageService } from '../services/storage.service';
+ 
+@Injectable({
+  providedIn: 'root'
+})
+export class IndexGuard implements CanActivate {
+  canActivate(): Promise<boolean> {
+    return new Promise(resolve => {
+      this.storageService.get(AuthConstants.AUTH).then( res => {
+        if (res) {
+          this.router.navigate(['home']);
+          resolve(false);
+        }
+        else {
+          resolve(true);
+        }
+      }).catch(err => {
+        resolve(false);
+      });
+    });
+  }
+ 
+  constructor(public storageService: StorageService, private router: Router) { }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/guards/index.html b/demo/ionic-dev/coverage/src/app/guards/index.html new file mode 100644 index 0000000..a1a578a --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/guards/index.html @@ -0,0 +1,125 @@ + + + + + + Code coverage report for src/app/guards + + + + + + + + +
+
+

All files src/app/guards

+
+ +
+ 90.91% + Statements + 20/22 +
+ + +
+ 100% + Branches + 4/4 +
+ + +
+ 80% + Functions + 8/10 +
+ + +
+ 88.89% + Lines + 16/18 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
home.guard.ts +
+
90.91%10/11100%2/280%4/588.89%8/9
index.guard.ts +
+
90.91%10/11100%2/280%4/588.89%8/9
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/home/home-routing.module.ts.html b/demo/ionic-dev/coverage/src/app/home/home-routing.module.ts.html new file mode 100644 index 0000000..e454fbd --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/home/home-routing.module.ts.html @@ -0,0 +1,226 @@ + + + + + + Code coverage report for src/app/home/home-routing.module.ts + + + + + + + + +
+
+

All files / src/app/home home-routing.module.ts

+
+ +
+ 45.45% + Statements + 5/11 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 25% + Functions + 2/8 +
+ + +
+ 40% + Lines + 4/10 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4x +4x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x + 
import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+ 
+import { HomePage } from './home.page';
+import { HomeGuard } from '../guards/home.guard';
+import { UserDataResolver } from '../resolvers/userData.resolver';
+ 
+export const routes: Routes = [
+  {
+    path: '',
+    component: HomePage,
+    canActivate: [HomeGuard],
+    resolve: {
+      userData: UserDataResolver,
+    },
+    children: [
+      {
+        path: 'dashboard',
+        loadChildren: () => import('../pages/dashboard/dashboard.module').then(
+          m => m.DashboardPageModule
+        )
+      },
+      {
+        path: '',
+        loadChildren: () => import('../pages/dashboard/dashboard.module').then(
+          m => m.DashboardPageModule
+        )
+      },
+      {
+        path: 'course-management',
+        loadChildren: () => import('../pages/course-management/course-management.module').then(
+          m => m.CourseManagementPageModule
+        )
+      },
+      {
+        path: 'settings',
+        loadChildren: () => import('../pages/settings/settings.module').then(
+          m => m.SettingsPageModule
+        )
+      }
+    ]
+  }
+];
+ 
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class HomePageRoutingModule {}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/home/home.module.ts.html b/demo/ionic-dev/coverage/src/app/home/home.module.ts.html new file mode 100644 index 0000000..4cb2e9d --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/home/home.module.ts.html @@ -0,0 +1,139 @@ + + + + + + Code coverage report for src/app/home/home.module.ts + + + + + + + + +
+
+

All files / src/app/home home.module.ts

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x + 
import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+ 
+import { IonicModule } from '@ionic/angular';
+ 
+import { HomePageRoutingModule } from './home-routing.module';
+ 
+import { HomePage } from './home.page';
+ 
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    HomePageRoutingModule
+  ],
+  declarations: [HomePage]
+})
+export class HomePageModule {}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/home/home.page.ts.html b/demo/ionic-dev/coverage/src/app/home/home.page.ts.html new file mode 100644 index 0000000..eeac889 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/home/home.page.ts.html @@ -0,0 +1,124 @@ + + + + + + Code coverage report for src/app/home/home.page.ts + + + + + + + + +
+
+

All files / src/app/home home.page.ts

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+ 
+@Component({
+  selector: 'app-home',
+  templateUrl: './home.page.html',
+  styleUrls: ['./home.page.scss'],
+})
+export class HomePage implements OnInit {
+ 
+  constructor() { }
+ 
+  ngOnInit() {
+  }
+ 
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/home/index.html b/demo/ionic-dev/coverage/src/app/home/index.html new file mode 100644 index 0000000..62ee884 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/home/index.html @@ -0,0 +1,140 @@ + + + + + + Code coverage report for src/app/home + + + + + + + + +
+
+

All files src/app/home

+
+ +
+ 60% + Statements + 9/15 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 40% + Functions + 4/10 +
+ + +
+ 50% + Lines + 6/12 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
home-routing.module.ts +
+
45.45%5/11100%0/025%2/840%4/10
home.module.ts +
+
100%2/2100%0/0100%0/0100%1/1
home.page.ts +
+
100%2/2100%0/0100%2/2100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/index.html b/demo/ionic-dev/coverage/src/app/index.html new file mode 100644 index 0000000..42db028 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/index.html @@ -0,0 +1,125 @@ + + + + + + Code coverage report for src/app + + + + + + + + +
+
+

All files src/app

+
+ +
+ 66.67% + Statements + 12/18 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 33.33% + Functions + 3/9 +
+ + +
+ 76.92% + Lines + 10/13 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
app-routing.module.ts +
+
33.33%3/9100%0/00%0/640%2/5
app.component.ts +
+
100%9/9100%0/0100%3/3100%8/8
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/index/index.html b/demo/ionic-dev/coverage/src/app/index/index.html new file mode 100644 index 0000000..e7c8342 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/index/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/index + + + + + + + + +
+
+

All files src/app/index

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
index.page.ts +
+
100%2/2100%0/0100%2/2100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/index/index.page.ts.html b/demo/ionic-dev/coverage/src/app/index/index.page.ts.html new file mode 100644 index 0000000..fbe7999 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/index/index.page.ts.html @@ -0,0 +1,124 @@ + + + + + + Code coverage report for src/app/index/index.page.ts + + + + + + + + +
+
+

All files / src/app/index index.page.ts

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+ 
+@Component({
+  selector: 'app-index',
+  templateUrl: './index.page.html',
+  styleUrls: ['./index.page.scss'],
+})
+export class IndexPage implements OnInit {
+ 
+  constructor() { }
+ 
+  ngOnInit() {
+  }
+ 
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/course-management/course-management.page.ts.html b/demo/ionic-dev/coverage/src/app/pages/course-management/course-management.page.ts.html new file mode 100644 index 0000000..c86a87b --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/course-management/course-management.page.ts.html @@ -0,0 +1,124 @@ + + + + + + Code coverage report for src/app/pages/course-management/course-management.page.ts + + + + + + + + +
+
+

All files / src/app/pages/course-management course-management.page.ts

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+ 
+@Component({
+  selector: 'app-course-management',
+  templateUrl: './course-management.page.html',
+  styleUrls: ['./course-management.page.scss'],
+})
+export class CourseManagementPage implements OnInit {
+ 
+  constructor() { }
+ 
+  ngOnInit() {
+  }
+ 
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/course-management/index.html b/demo/ionic-dev/coverage/src/app/pages/course-management/index.html new file mode 100644 index 0000000..257a910 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/course-management/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/pages/course-management + + + + + + + + +
+
+

All files src/app/pages/course-management

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
course-management.page.ts +
+
100%2/2100%0/0100%2/2100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard-routing.module.ts.html b/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard-routing.module.ts.html new file mode 100644 index 0000000..4be4920 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard-routing.module.ts.html @@ -0,0 +1,130 @@ + + + + + + Code coverage report for src/app/pages/dashboard/dashboard-routing.module.ts + + + + + + + + +
+
+

All files / src/app/pages/dashboard dashboard-routing.module.ts

+
+ +
+ 100% + Statements + 3/3 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 2/2 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18  +  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +1x + 
import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+ 
+import { DashboardPage } from './dashboard.page';
+ 
+const routes: Routes = [
+  {
+    path: '',
+    component: DashboardPage
+  }
+];
+ 
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class DashboardPageRoutingModule {}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.module.ts.html b/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.module.ts.html new file mode 100644 index 0000000..6e4d6e8 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.module.ts.html @@ -0,0 +1,139 @@ + + + + + + Code coverage report for src/app/pages/dashboard/dashboard.module.ts + + + + + + + + +
+
+

All files / src/app/pages/dashboard dashboard.module.ts

+
+ +
+ 100% + Statements + 2/2 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x + 
import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+ 
+import { IonicModule } from '@ionic/angular';
+ 
+import { DashboardPageRoutingModule } from './dashboard-routing.module';
+ 
+import { DashboardPage } from './dashboard.page';
+ 
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    DashboardPageRoutingModule
+  ],
+  declarations: [DashboardPage]
+})
+export class DashboardPageModule {}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.page.ts.html b/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.page.ts.html new file mode 100644 index 0000000..430b918 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/dashboard/dashboard.page.ts.html @@ -0,0 +1,139 @@ + + + + + + Code coverage report for src/app/pages/dashboard/dashboard.page.ts + + + + + + + + +
+
+

All files / src/app/pages/dashboard dashboard.page.ts

+
+ +
+ 100% + Statements + 5/5 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 3/3 +
+ + +
+ 100% + Lines + 4/4 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +1x +  +  +14x +  +  +16x +16x +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+import { AuthService } from 'src/app/services/auth.service';
+ 
+@Component({
+  selector: 'app-dashboard',
+  templateUrl: './dashboard.page.html',
+  styleUrls: ['./dashboard.page.scss'],
+})
+export class DashboardPage implements OnInit {
+  displayUserData: any;
+ 
+  constructor(private authService: AuthService) { }
+ 
+  ngOnInit() {
+    this.authService.userData$.subscribe((res: any) => {
+      this.displayUserData = res;
+    })
+  }
+ 
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/dashboard/index.html b/demo/ionic-dev/coverage/src/app/pages/dashboard/index.html new file mode 100644 index 0000000..01181ba --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/dashboard/index.html @@ -0,0 +1,140 @@ + + + + + + Code coverage report for src/app/pages/dashboard + + + + + + + + +
+
+

All files src/app/pages/dashboard

+
+ +
+ 100% + Statements + 10/10 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 3/3 +
+ + +
+ 100% + Lines + 7/7 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
dashboard-routing.module.ts +
+
100%3/3100%0/0100%0/0100%2/2
dashboard.module.ts +
+
100%2/2100%0/0100%0/0100%1/1
dashboard.page.ts +
+
100%5/5100%0/0100%3/3100%4/4
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/settings/index.html b/demo/ionic-dev/coverage/src/app/pages/settings/index.html new file mode 100644 index 0000000..0d2ae5c --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/settings/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/pages/settings + + + + + + + + +
+
+

All files src/app/pages/settings

+
+ +
+ 75% + Statements + 3/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 66.67% + Functions + 2/3 +
+ + +
+ 66.67% + Lines + 2/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
settings.page.ts +
+
75%3/4100%0/066.67%2/366.67%2/3
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/settings/settings.page.ts.html b/demo/ionic-dev/coverage/src/app/pages/settings/settings.page.ts.html new file mode 100644 index 0000000..729d54d --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/settings/settings.page.ts.html @@ -0,0 +1,136 @@ + + + + + + Code coverage report for src/app/pages/settings/settings.page.ts + + + + + + + + +
+
+

All files / src/app/pages/settings settings.page.ts

+
+ +
+ 75% + Statements + 3/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 66.67% + Functions + 2/3 +
+ + +
+ 66.67% + Lines + 2/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20  +  +  +  +  +  +  +  +1x +  +14x +  +  +  +  +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+import { AuthService } from 'src/app/services/auth.service';
+ 
+@Component({
+  selector: 'app-settings',
+  templateUrl: './settings.page.html',
+  styleUrls: ['./settings.page.scss'],
+})
+export class SettingsPage implements OnInit {
+ 
+  constructor(private authService: AuthService) { }
+ 
+  ngOnInit() {
+  }
+ 
+  logoutAction() {
+    this.authService.signout();
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/signin/index.html b/demo/ionic-dev/coverage/src/app/pages/signin/index.html new file mode 100644 index 0000000..3e3017c --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/signin/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/pages/signin + + + + + + + + +
+
+

All files src/app/pages/signin

+
+ +
+ 100% + Statements + 23/23 +
+ + +
+ 100% + Branches + 16/16 +
+ + +
+ 100% + Functions + 6/6 +
+ + +
+ 100% + Lines + 22/22 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
signin.page.ts +
+
100%23/23100%16/16100%6/6100%22/22
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/pages/signin/signin.page.ts.html b/demo/ionic-dev/coverage/src/app/pages/signin/signin.page.ts.html new file mode 100644 index 0000000..7a07274 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/pages/signin/signin.page.ts.html @@ -0,0 +1,289 @@ + + + + + + Code coverage report for src/app/pages/signin/signin.page.ts + + + + + + + + +
+
+

All files / src/app/pages/signin signin.page.ts

+
+ +
+ 100% + Statements + 23/23 +
+ + +
+ 100% + Branches + 16/16 +
+ + +
+ 100% + Functions + 6/6 +
+ + +
+ 100% + Lines + 22/22 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71  +  +  +  +  +  +  +  +  +  +  +  +1x +64x +  +  +  +  +  +64x +64x +64x +64x +  +  +  +  +  +  +4x +4x +  +4x +  +  +  +  +  +  +  +9x +5x +  +4x +3x +3x +  +  +1x +  +  +  +1x +  +  +  +4x +2x +  +  +2x +1x +  +2x +1x +  +  +  +  +  + 
import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { AuthService } from 'src/app/services/auth.service';
+import { StorageService } from 'src/app/services/storage.service';
+import { AuthConstants } from 'src/app/config/auth-constants';
+import { ToastService } from 'src/app/services/toast.service';
+ 
+@Component({
+  selector: 'app-login',
+  templateUrl: './signin.page.html',
+  styleUrls: ['./signin.page.scss'],
+})
+export class SignInPage implements OnInit {
+  public postData = {
+    witsemail: '',
+    password: ''
+  }
+ 
+  constructor(
+    private router: Router, 
+    private authService: AuthService, 
+    private storageService: StorageService,
+    private toastService: ToastService
+    ) { }
+ 
+  ngOnInit() {
+  }
+ 
+  validateInputs() {
+    let witsemail = this.postData.witsemail.trim();
+    let password = this.postData.password.trim();
+ 
+    return ( 
+      this.postData.witsemail && 
+      this.postData.password && 
+      witsemail.length > 0 && 
+      password.length > 0)
+  }
+ 
+  loginAction() {
+    if (this.validateInputs()) {
+      this.authService.signin(this.postData).subscribe(
+        (res: any) => {
+          if(!(res.error)){
+            this.storageService.store(AuthConstants.AUTH, res);
+            this.router.navigate(['home']);
+          }
+          else {
+          this.toastService.presentToast("Incorrect username or password");
+          }
+        },
+        (error: any) => {
+        this.toastService.presentToast("Network connection error.")
+      })
+    }
+    else {
+      if (this.postData.witsemail.trim().length == 0 && this.postData.password.trim().length == 0) {
+        this.toastService.presentToast("Please enter a wits email address and password.");
+      }
+      else {
+        if (this.postData.password.trim().length == 0) {
+          this.toastService.presentToast("Please enter a password.");
+        }
+        if (this.postData.witsemail.trim().length == 0) {
+          this.toastService.presentToast("Please enter a wits email address.");
+        }
+      }
+    }
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/resolvers/index.html b/demo/ionic-dev/coverage/src/app/resolvers/index.html new file mode 100644 index 0000000..50d33d5 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/resolvers/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/app/resolvers + + + + + + + + +
+
+

All files src/app/resolvers

+
+ +
+ 50% + Statements + 2/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 33.33% + Lines + 1/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
userData.resolver.ts +
+
50%2/4100%0/00%0/233.33%1/3
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/resolvers/userData.resolver.ts.html b/demo/ionic-dev/coverage/src/app/resolvers/userData.resolver.ts.html new file mode 100644 index 0000000..9e893c9 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/resolvers/userData.resolver.ts.html @@ -0,0 +1,124 @@ + + + + + + Code coverage report for src/app/resolvers/userData.resolver.ts + + + + + + + + +
+
+

All files / src/app/resolvers userData.resolver.ts

+
+ +
+ 50% + Statements + 2/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/2 +
+ + +
+ 33.33% + Lines + 1/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16  +  +  +  +  +  +  +1x +  +  +  +  +  +  +  + 
import { Injectable } from '@angular/core';
+import { AuthService } from '../services/auth.service';
+ 
+@Injectable({
+    providedIn: 'root'
+})
+ 
+export class UserDataResolver {
+    
+ 
+    constructor(private authService: AuthService) { }
+ 
+    resolve() {
+        return this.authService.getUserData();
+    }
+}
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/services/auth.service.ts.html b/demo/ionic-dev/coverage/src/app/services/auth.service.ts.html new file mode 100644 index 0000000..dcce893 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/services/auth.service.ts.html @@ -0,0 +1,193 @@ + + + + + + Code coverage report for src/app/services/auth.service.ts + + + + + + + + +
+
+

All files / src/app/services auth.service.ts

+
+ +
+ 50% + Statements + 6/12 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 16.67% + Functions + 1/6 +
+ + +
+ 45.45% + Lines + 5/11 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39  +  +  +  +  +  +  +  +  +  +  +  +1x +93x +  +  +93x +93x +93x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { Injectable } from '@angular/core';
+import { Router } from '@angular/router';
+ 
+import { HttpService } from './http.service';
+import { StorageService } from './storage.service';
+import { Observable, BehaviorSubject } from 'rxjs';
+import { AuthConstants } from '../config/auth-constants';
+ 
+ 
+@Injectable({
+  providedIn: 'root'
+})
+export class AuthService {
+  userData$ = new BehaviorSubject<any>('');
+ 
+  constructor(
+    private httpService: HttpService, 
+    private storageService: StorageService, 
+    private router: Router
+    ) { }
+ 
+  getUserData() {
+    this.storageService.get(AuthConstants.AUTH).then(res => {
+      this.userData$.next(res);
+    })
+  }
+ 
+  signin (postData: any): Observable<any> {
+    return this.httpService.post('signin', postData)
+  }
+ 
+  signout () {
+    this.storageService.removeItem(AuthConstants.AUTH).then(res => {
+      this.userData$.next('');
+      this.router.navigate(['signin']);
+    })
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/services/http.service.ts.html b/demo/ionic-dev/coverage/src/app/services/http.service.ts.html new file mode 100644 index 0000000..7019622 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/services/http.service.ts.html @@ -0,0 +1,136 @@ + + + + + + Code coverage report for src/app/services/http.service.ts + + + + + + + + +
+
+

All files / src/app/services http.service.ts

+
+ +
+ 42.86% + Statements + 3/7 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 50% + Functions + 1/2 +
+ + +
+ 33.33% + Lines + 2/6 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20  +  +  +  +  +  +  +1x +  +95x +  +  +  +  +  +  +  +  +  + 
import { Injectable } from '@angular/core';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
+import { environment } from 'src/environments/environment';
+ 
+@Injectable({
+  providedIn: 'root'
+})
+export class HttpService {
+ 
+  constructor(private http: HttpClient ) { }
+ 
+  post (serviceName: string, data: any) {
+    const headers = new HttpHeaders();
+    const options = { header: headers, withCredentials: false };
+ 
+    const url = environment.apiURL + serviceName;
+    return this.http.post(url, JSON.stringify(data), options)
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/services/index.html b/demo/ionic-dev/coverage/src/app/services/index.html new file mode 100644 index 0000000..90ce0e4 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/services/index.html @@ -0,0 +1,155 @@ + + + + + + Code coverage report for src/app/services + + + + + + + + +
+
+

All files src/app/services

+
+ +
+ 57.14% + Statements + 20/35 +
+ + +
+ 50% + Branches + 1/2 +
+ + +
+ 40% + Functions + 6/15 +
+ + +
+ 51.61% + Lines + 16/31 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
auth.service.ts +
+
50%6/12100%0/016.67%1/645.45%5/11
http.service.ts +
+
42.86%3/7100%0/050%1/233.33%2/6
storage.service.ts +
+
72.73%8/1150%1/260%3/570%7/10
toast.service.ts +
+
60%3/5100%0/050%1/250%2/4
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/services/storage.service.ts.html b/demo/ionic-dev/coverage/src/app/services/storage.service.ts.html new file mode 100644 index 0000000..b804fa5 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/services/storage.service.ts.html @@ -0,0 +1,193 @@ + + + + + + Code coverage report for src/app/services/storage.service.ts + + + + + + + + +
+
+

All files / src/app/services storage.service.ts

+
+ +
+ 72.73% + Statements + 8/11 +
+ + +
+ 50% + Branches + 1/2 +
+ + +
+ 60% + Functions + 3/5 +
+ + +
+ 70% + Lines + 7/10 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39  +  +  +1x +  +  +  +  +1x +  +  +  +  +2x +2x +  +  +  +  +  +  +2x +2x +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
import { Injectable } from '@angular/core';
+import { Plugins } from '@capacitor/core';
+ 
+const { Storage } = Plugins;
+ 
+@Injectable({
+  providedIn: 'root'
+})
+export class StorageService {
+ 
+  constructor() { }
+ 
+  async store (storageKey: string, value: any){
+    const encryptedValue = btoa(escape(JSON.stringify(value)));
+    await Storage.set({
+      key: storageKey,
+      value: encryptedValue
+    });
+  }
+ 
+  async get(storageKey: string) {
+    const res = await Storage.get({key: storageKey});
+    Eif(res.value) {
+      return JSON.parse(unescape(atob(res.value)));
+    }
+    else {
+      return false;
+    }
+  }
+ 
+  async removeItem(storageKey: string) {
+    await Storage.remove({ key: storageKey });
+  }
+ 
+  async clear() {
+    await Storage.clear();
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/app/services/toast.service.ts.html b/demo/ionic-dev/coverage/src/app/services/toast.service.ts.html new file mode 100644 index 0000000..f43be37 --- /dev/null +++ b/demo/ionic-dev/coverage/src/app/services/toast.service.ts.html @@ -0,0 +1,133 @@ + + + + + + Code coverage report for src/app/services/toast.service.ts + + + + + + + + +
+
+

All files / src/app/services toast.service.ts

+
+ +
+ 60% + Statements + 3/5 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 50% + Functions + 1/2 +
+ + +
+ 50% + Lines + 2/4 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +1x +  +65x +  +  +  +  +  +  +  +  +  + 
import { Injectable } from '@angular/core';
+import { ToastController } from '@ionic/angular';
+ 
+@Injectable({
+  providedIn: 'root'
+})
+export class ToastService {
+ 
+  constructor(public toastController: ToastController ) { }
+ 
+  async presentToast (infoMessage: string) {
+    const toast = await this.toastController.create({
+      message: infoMessage,
+      duration: 2000
+    });
+    toast.present();
+  }
+}
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/environments/environment.ts.html b/demo/ionic-dev/coverage/src/environments/environment.ts.html new file mode 100644 index 0000000..b0a225d --- /dev/null +++ b/demo/ionic-dev/coverage/src/environments/environment.ts.html @@ -0,0 +1,130 @@ + + + + + + Code coverage report for src/environments/environment.ts + + + + + + + + +
+
+

All files / src/environments environment.ts

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18  +  +  +  +1x +  +  +  +  +  +  +  +  +  +  +  +  + 
// This file can be replaced during build by using the `fileReplacements` array.
+// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
+// The list of file replacements can be found in `angular.json`.
+ 
+export const environment = {
+  production: false,
+  apiURL: 'http://localhost:8084/'
+};
+ 
+/*
+ * For easier debugging in development mode, you can import the following file
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
+ *
+ * This import should be commented out in production mode because it will have a negative impact
+ * on performance if an error is thrown.
+ */
+// import 'zone.js/dist/zone-error';  // Included with Angular CLI.
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/environments/index.html b/demo/ionic-dev/coverage/src/environments/index.html new file mode 100644 index 0000000..1d75373 --- /dev/null +++ b/demo/ionic-dev/coverage/src/environments/index.html @@ -0,0 +1,110 @@ + + + + + + Code coverage report for src/environments + + + + + + + + +
+
+

All files src/environments

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
environment.ts +
+
100%1/1100%0/0100%0/0100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/index.html b/demo/ionic-dev/coverage/src/index.html new file mode 100644 index 0000000..7336114 --- /dev/null +++ b/demo/ionic-dev/coverage/src/index.html @@ -0,0 +1,140 @@ + + + + + + Code coverage report for src + + + + + + + + +
+
+

All files src

+
+ +
+ 100% + Statements + 4/4 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 4/4 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
polyfills.ts +
+
0%0/00%0/00%0/00%0/0
test.ts +
+
100%3/3100%0/0100%0/0100%3/3
zone-flags.ts +
+
100%1/1100%0/0100%0/0100%1/1
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/polyfills.ts.html b/demo/ionic-dev/coverage/src/polyfills.ts.html new file mode 100644 index 0000000..2121a9c --- /dev/null +++ b/demo/ionic-dev/coverage/src/polyfills.ts.html @@ -0,0 +1,277 @@ + + + + + + Code coverage report for src/polyfills.ts + + + + + + + + +
+
+

All files / src polyfills.ts

+
+ +
+ 0% + Statements + 0/0 +
+ + +
+ 0% + Branches + 0/0 +
+ + +
+ 0% + Functions + 0/0 +
+ + +
+ 0% + Lines + 0/0 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
/**
+ * This file includes polyfills needed by Angular and is loaded before the app.
+ * You can add your own extra polyfills to this file.
+ *
+ * This file is divided into 2 sections:
+ *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
+ *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
+ *      file.
+ *
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
+ *
+ * Learn more in https://angular.io/guide/browser-support
+ */
+ 
+/***************************************************************************************************
+ * BROWSER POLYFILLS
+ */
+ 
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
+// import 'classlist.js';  // Run `npm install --save classlist.js`.
+ 
+/**
+ * Web Animations `@angular/platform-browser/animations`
+ * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
+ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
+ */
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
+ 
+/**
+ * By default, zone.js will patch all possible macroTask and DomEvents
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
+ * because those flags need to be set before `zone.js` being loaded, and webpack
+ * will put import in the top of bundle, so user need to create a separate file
+ * in this directory (for example: zone-flags.ts), and put the following flags
+ * into that file, and then add the following code before importing zone.js.
+ * import './zone-flags.ts';
+ *
+ * The flags allowed in zone-flags.ts are listed here.
+ *
+ * The following flags will work for all browsers.
+ *
+ * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
+ * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
+ * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
+ *
+ *  in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
+ *  with the following flag, it will bypass `zone.js` patch for IE/Edge
+ *
+ *  (window as any).__Zone_enable_cross_context_check = true;
+ *
+ */
+ 
+import './zone-flags';
+ 
+/***************************************************************************************************
+ * Zone JS is required by default for Angular itself.
+ */
+ 
+import 'zone.js/dist/zone';  // Included with Angular CLI.
+ 
+ 
+/***************************************************************************************************
+ * APPLICATION IMPORTS
+ */
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/test.ts.html b/demo/ionic-dev/coverage/src/test.ts.html new file mode 100644 index 0000000..90c575a --- /dev/null +++ b/demo/ionic-dev/coverage/src/test.ts.html @@ -0,0 +1,139 @@ + + + + + + Code coverage report for src/test.ts + + + + + + + + +
+
+

All files / src test.ts

+
+ +
+ 100% + Statements + 3/3 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 3/3 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21  +  +  +  +  +  +  +  +  +  +  +  +1x +  +  +  +  +1x +  +1x + 
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
+ 
+import 'zone.js/dist/zone-testing';
+import { getTestBed } from '@angular/core/testing';
+import {
+  BrowserDynamicTestingModule,
+  platformBrowserDynamicTesting
+} from '@angular/platform-browser-dynamic/testing';
+ 
+declare const require: any;
+ 
+// First, initialize the Angular testing environment.
+getTestBed().initTestEnvironment(
+  BrowserDynamicTestingModule,
+  platformBrowserDynamicTesting()
+);
+// Then we find all the tests.
+const context = require.context('./', true, /\.spec\.ts$/);
+// And load the modules.
+context.keys().map(context);
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/coverage/src/zone-flags.ts.html b/demo/ionic-dev/coverage/src/zone-flags.ts.html new file mode 100644 index 0000000..d3b91bd --- /dev/null +++ b/demo/ionic-dev/coverage/src/zone-flags.ts.html @@ -0,0 +1,94 @@ + + + + + + Code coverage report for src/zone-flags.ts + + + + + + + + +
+
+

All files / src zone-flags.ts

+
+ +
+ 100% + Statements + 1/1 +
+ + +
+ 100% + Branches + 0/0 +
+ + +
+ 100% + Functions + 0/0 +
+ + +
+ 100% + Lines + 1/1 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+
+
+

+
1 +2 +3 +4 +5 +6  +  +  +  +1x + 
/**
+ * Prevents Angular change detection from
+ * running with certain Web Component callbacks
+ */
+(window as any).__Zone_disable_customElements = true;
+ 
+ +
+
+ + + + + + + + + \ No newline at end of file diff --git a/demo/ionic-dev/greenpeace/package-lock.json b/demo/ionic-dev/greenpeace/package-lock.json index 805daf9..7de6f14 100644 --- a/demo/ionic-dev/greenpeace/package-lock.json +++ b/demo/ionic-dev/greenpeace/package-lock.json @@ -2329,6 +2329,18 @@ "integrity": "sha512-jRHfWsvyMtXdbhnz5CVHxaBgnV6duZnPlQuRSo/dm/GnmikNcmZhxIES4E9OZjUmQ8C+HCl4KJux+cXN/ErGDQ==", "dev": true }, + "@types/q": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", + "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=", + "dev": true + }, + "@types/selenium-webdriver": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-4.0.9.tgz", + "integrity": "sha512-HopIwBE7GUXsscmt/J0DhnFXLSmO04AfxT6b8HAprknwka7pqEWquWDMXxCjd+NUHK9MkCe1SDKKsMiNmCItbQ==", + "dev": true + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -5092,6 +5104,12 @@ "strip-eof": "^1.0.0" } }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -6917,19 +6935,20 @@ } }, "jasmine": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", - "integrity": "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", + "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", "dev": true, "requires": { - "glob": "^7.1.4", - "jasmine-core": "~3.5.0" + "exit": "^0.1.2", + "glob": "^7.0.6", + "jasmine-core": "~2.8.0" }, "dependencies": { "jasmine-core": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", - "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=", "dev": true } } @@ -6949,6 +6968,12 @@ "colors": "1.1.2" } }, + "jasminewd2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz", + "integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=", + "dev": true + }, "jest-worker": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", @@ -9382,23 +9407,34 @@ } }, "protractor": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/protractor/-/protractor-6.0.0.tgz", - "integrity": "sha512-kCV1hK9gAh+N9to04oXLXtqnnG/UX/aDL2YvLS0SYqzzpeLt8Are3y3JPjWC/OSsYBkOW8T1cXmcMn0QaGUudw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/protractor/-/protractor-7.0.0.tgz", + "integrity": "sha512-UqkFjivi4GcvUQYzqGYNe0mLzfn5jiLmO8w9nMhQoJRLhy2grJonpga2IWhI6yJO30LibWXJJtA4MOIZD2GgZw==", "dev": true, "requires": { + "@types/q": "^0.0.32", + "@types/selenium-webdriver": "^3.0.0", "blocking-proxy": "^1.0.0", "browserstack": "^1.5.1", "chalk": "^1.1.3", "glob": "^7.0.3", - "jasmine": "^3.3.1", - "optimist": "~0.6.0", + "jasmine": "2.8.0", + "jasminewd2": "^2.1.0", + "q": "1.4.1", "saucelabs": "^1.5.0", - "selenium-webdriver": "^4.0.0-alpha.1", + "selenium-webdriver": "3.6.0", "source-map-support": "~0.4.0", - "webdriver-manager": "13.0.0" + "webdriver-js-extender": "2.1.0", + "webdriver-manager": "^12.1.7", + "yargs": "^15.3.1" }, "dependencies": { + "@types/selenium-webdriver": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", + "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -9424,6 +9460,160 @@ "supports-color": "^2.0.0" } }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -9439,6 +9629,34 @@ "source-map": "^0.5.6" } }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -9455,18 +9673,89 @@ "dev": true }, "webdriver-manager": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-13.0.0.tgz", - "integrity": "sha512-nwcbUWZwwqw4Nn+Xs8rgyX5JWDJ3oOAEc+OMI9sp8QlM7yg1CDaqqk/2DRZI/ig3DxQwZ1Xna3Eq0unNUaSQvA==", + "version": "12.1.7", + "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.1.7.tgz", + "integrity": "sha512-XINj6b8CYuUYC93SG3xPkxlyUc3IJbD6Vvo75CVGuG9uzsefDzWQrhz0Lq8vbPxtb4d63CZdYophF8k8Or/YiA==", "dev": true, "requires": { - "adm-zip": "^0.4.13", - "loglevel": "^1.6.1", - "request": "^2.88.0", - "semver": "^5.6.0", - "tar": "^4.4.8", - "xml2js": "^0.4.19", - "yargs": "^12.0.5" + "adm-zip": "^0.4.9", + "chalk": "^1.1.1", + "del": "^2.2.0", + "glob": "^7.0.3", + "ini": "^1.3.4", + "minimist": "^1.2.0", + "q": "^1.4.1", + "request": "^2.87.0", + "rimraf": "^2.5.2", + "semver": "^5.3.0", + "xml2js": "^0.4.17" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -9552,6 +9841,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + }, "qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", @@ -10157,14 +10452,15 @@ "dev": true }, "selenium-webdriver": { - "version": "4.0.0-alpha.7", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.7.tgz", - "integrity": "sha512-D4qnTsyTr91jT8f7MfN+OwY0IlU5+5FmlO5xlgRUV6hDEV8JyYx2NerdTEqDDkNq7RZDYc4VoPALk8l578RBHw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz", + "integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==", "dev": true, "requires": { - "jszip": "^3.2.2", - "rimraf": "^2.7.1", - "tmp": "0.0.30" + "jszip": "^3.1.3", + "rimraf": "^2.5.4", + "tmp": "0.0.30", + "xml2js": "^0.4.17" }, "dependencies": { "tmp": { @@ -12980,6 +13276,24 @@ "minimalistic-assert": "^1.0.0" } }, + "webdriver-js-extender": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", + "integrity": "sha512-lcUKrjbBfCK6MNsh7xaY2UAUmZwe+/ib03AjVOpFobX4O7+83BUveSrLfU0Qsyb1DaKJdQRbuU+kM9aZ6QUhiQ==", + "dev": true, + "requires": { + "@types/selenium-webdriver": "^3.0.0", + "selenium-webdriver": "^3.0.1" + }, + "dependencies": { + "@types/selenium-webdriver": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", + "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", + "dev": true + } + } + }, "webpack": { "version": "4.39.2", "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.39.2.tgz", diff --git a/demo/ionic-dev/greenpeace/package.json b/demo/ionic-dev/greenpeace/package.json index 2b52726..1fffd13 100644 --- a/demo/ionic-dev/greenpeace/package.json +++ b/demo/ionic-dev/greenpeace/package.json @@ -8,6 +8,9 @@ "start": "ng serve", "build": "ng build", "test": "ng test", + "test --no-watch --code-coverage": "ng test --no-watch --code-coverage", + "test --code-coverage": "ng test --code-coverage", + "test --no-watch": "ng test --no-watch", "lint": "ng lint", "e2e": "ng e2e" }, @@ -40,6 +43,7 @@ "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", + "@types/selenium-webdriver": "^4.0.9", "codelyzer": "^5.0.0", "coveralls": "^3.1.0", "jasmine-core": "~3.4.0", @@ -53,7 +57,7 @@ "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "nodeunit": "^0.11.3", - "protractor": "^6.0.0", + "protractor": "^7.0.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", "typescript": "~3.4.3" diff --git a/demo/ionic-dev/greenpeace/src/app/components/logo/logo.component.spec.ts b/demo/ionic-dev/greenpeace/src/app/components/logo/logo.component.spec.ts index a54aec5..d835f6a 100644 --- a/demo/ionic-dev/greenpeace/src/app/components/logo/logo.component.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/components/logo/logo.component.spec.ts @@ -1,3 +1,10 @@ +/* TESTED +- Contains an image to be used as a logo. +- Image is hosted at 'assets/images/wits-logo.png'. +- Image has an alt. +- The alt reads 'University of Witwatersrand Logo'. +*/ + import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; @@ -18,7 +25,33 @@ describe('LogoComponent', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + + it('should have an tag', () => { + expect(fixture.nativeElement.querySelector('img')).toBeTruthy(); + }); + + describe(' tag:', () => { + it('should have an alt property', () => { + expect(fixture.nativeElement.querySelector('img').alt).toBeTruthy(); + }); + + it('should have a src property', () => { + expect(fixture.nativeElement.querySelector('img').src).toBeTruthy(); + }); + + describe('alt:', () => { + it('should be \'University of Witwatersrand Logo\'', () => { + expect(fixture.nativeElement.querySelector('img').alt).toBe('University of Witwatersrand Logo'); + }); + }); + + describe('src:', () => { + it('should contain \'assets\\images\\wits-log.png\'', () => { + expect(fixture.nativeElement.querySelector('img').src).toContain('assets/images/wits-logo.png'); + }); + }); + }); }); diff --git a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.html b/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.html deleted file mode 100644 index bbadb7d..0000000 --- a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.html +++ /dev/null @@ -1,4 +0,0 @@ -
- {{ name }} -

Explore UI Components

-
\ No newline at end of file diff --git a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.scss b/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.scss deleted file mode 100644 index 8993e7c..0000000 --- a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.scss +++ /dev/null @@ -1,27 +0,0 @@ -#container { - text-align: center; - - position: absolute; - left: 0; - right: 0; - top: 50%; - transform: translateY(-50%); -} - -#container strong { - font-size: 20px; - line-height: 26px; -} - -#container p { - font-size: 16px; - line-height: 22px; - - color: #8c8c8c; - - margin: 0; -} - -#container a { - text-decoration: none; -} \ No newline at end of file diff --git a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.spec.ts b/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.spec.ts deleted file mode 100644 index 9f56ba6..0000000 --- a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { IonicModule } from '@ionic/angular'; - -import { ExploreContainerComponent } from './explore-container.component'; - -describe('ExploreContainerComponent', () => { - let component: ExploreContainerComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ExploreContainerComponent ], - imports: [IonicModule.forRoot()] - }).compileComponents(); - - fixture = TestBed.createComponent(ExploreContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - })); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.ts b/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.ts deleted file mode 100644 index 60554cb..0000000 --- a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; - -@Component({ - selector: 'app-explore-container', - templateUrl: './explore-container.component.html', - styleUrls: ['./explore-container.component.scss'], -}) -export class ExploreContainerComponent implements OnInit { - @Input() name: string; - - constructor() { } - - ngOnInit() {} - -} diff --git a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.module.ts b/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.module.ts deleted file mode 100644 index 4376296..0000000 --- a/demo/ionic-dev/greenpeace/src/app/explore-container/explore-container.module.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import { IonicModule } from '@ionic/angular'; - -import { ExploreContainerComponent } from './explore-container.component'; - -@NgModule({ - imports: [ CommonModule, FormsModule, IonicModule], - declarations: [ExploreContainerComponent], - exports: [ExploreContainerComponent] -}) -export class ExploreContainerComponentModule {} diff --git a/demo/ionic-dev/greenpeace/src/app/guards/home.guard.spec.ts b/demo/ionic-dev/greenpeace/src/app/guards/home.guard.spec.ts index 4fb5f0d..a939bf1 100644 --- a/demo/ionic-dev/greenpeace/src/app/guards/home.guard.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/guards/home.guard.spec.ts @@ -1,17 +1,106 @@ +/*UNTESTED +- Guards routing to protected routes +- If a user has authentication, it will send them to their requested route +- If a user does not have authentication, it will send them to the default route +- To check for authentication, the guard checks the storage for a storage key +held in auth constants. + - If the key exists in storage, the key is returned. + - If the key does not exist in storage, the storage returns false. +*/ + import { RouterTestingModule } from "@angular/router/testing"; -import { TestBed, async, inject } from '@angular/core/testing'; +import { Router } from '@angular/router'; +import { TestBed, inject, fakeAsync, tick } from '@angular/core/testing'; import { HomeGuard } from './home.guard'; +import { StorageService } from '../services/storage.service'; +import { routes } from '../home/home-routing.module'; +import { HomePageModule } from '../home/home.module'; +import { throwError } from 'rxjs'; +import { promise } from 'protractor'; +import { resolve } from 'url'; describe('HomeGuard', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [RouterTestingModule], - providers: [HomeGuard] + imports: [RouterTestingModule.withRoutes(routes),HomePageModule], + providers: [HomeGuard, StorageService] }); }); - it('should ...', inject([HomeGuard], (guard: HomeGuard) => { + it('should exist', inject([HomeGuard], (guard: HomeGuard) => { expect(guard).toBeTruthy(); })); -}); + + it('should have a canActivate() function', inject([HomeGuard], (guard: HomeGuard) => { + expect(guard.canActivate).toBeDefined(); + })); + + // describe('canActivate():', () => { + // let guard: HomeGuard; + // let storageService: StorageService; + // let storageServiceSpy: any; + // let router: Router; + // let routerSpy: any; + + // it('should return false and redirect to \\signin if storage service returns false', (done) => { + // storageService = new StorageService; + // storageServiceSpy = spyOn(storageService,'get'); + // router = TestBed.get(Router); + // routerSpy = spyOn(router,'navigate'); + + // storageServiceSpy.and.returnValue(Promise.resolve(false)); + // router.initialNavigation(); + // guard = new HomeGuard(storageService,router); + + // guard.canActivate() + // .then((resolve) => { + // expect(resolve).toBeFalsy(); + // expect(routerSpy).toHaveBeenCalledWith(['signin']); + // done(); + // }); + // }); + + // it('should return true and not redirect to \\signin if storage service returns true', (done) => { + // storageService = new StorageService; + // storageServiceSpy = spyOn(storageService,'get'); + // router = TestBed.get(Router); + // routerSpy = spyOn(router,'navigate'); + + // storageServiceSpy.and.returnValue(Promise.resolve(true)); + // router.initialNavigation(); + // guard = new HomeGuard(storageService,router); + + // guard.canActivate() + // .then((resolve) => { + // expect(resolve).toBeTruthy(); + // expect(routerSpy).not.toHaveBeenCalled(); + // done(); + // }); + // }); + + // it('should return true and not redirect to \\signin if storage service returns true', (done) => { + // storageService = new StorageService; + // storageServiceSpy = spyOn(storageService,'get'); + // router = TestBed.get(Router); + // routerSpy = spyOn(router,'navigate'); + + // storageServiceSpy.and.returnValue(throwError({})) + // router.initialNavigation(); + // guard = new HomeGuard(storageService,router); + + // guard.canActivate() + // .then( () => { resolve => { + // expect(resolve).toBeTruthy(); + // done(); + // }; + // }); + // }); + +/* +TODO: test the exception of the promise. +*/ + + + // }); +}); \ No newline at end of file diff --git a/demo/ionic-dev/greenpeace/src/app/guards/index.guard.spec.ts b/demo/ionic-dev/greenpeace/src/app/guards/index.guard.spec.ts index a5417c6..ebcf22f 100644 --- a/demo/ionic-dev/greenpeace/src/app/guards/index.guard.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/guards/index.guard.spec.ts @@ -1,7 +1,9 @@ import { RouterTestingModule } from "@angular/router/testing"; import { TestBed, async, inject } from '@angular/core/testing'; +import { Router } from '@angular/router'; import { IndexGuard } from './index.guard'; +import { StorageService } from '../services/storage.service'; describe('IndexGuard', () => { beforeEach(() => { @@ -11,7 +13,56 @@ describe('IndexGuard', () => { }); }); - it('should ...', inject([IndexGuard], (guard: IndexGuard) => { + it('should exist', inject([IndexGuard], (guard: IndexGuard) => { expect(guard).toBeTruthy(); })); -}); + + it('should have a canActivate() function', inject([IndexGuard], (guard: IndexGuard) => { + expect(guard.canActivate).toBeDefined(); + })); + + describe('canActivate():', () => { + let location: Location; + let guard: IndexGuard; + let storageService: StorageService; + let storageServiceSpy: any; + let router: Router; + let routerSpy: any; + + it('should return true and not redirect to \\signin if storage service returns false', (done) => { + storageService = new StorageService; + storageServiceSpy = spyOn(storageService,'get'); + router = TestBed.get(Router); + routerSpy = spyOn(router,'navigate'); + + storageServiceSpy.and.returnValue(Promise.resolve(false)); + router.initialNavigation(); + guard = new IndexGuard(storageService,router); + + guard.canActivate() + .then((resolve) => { + expect(resolve).toBeTruthy(); + expect(routerSpy).not.toHaveBeenCalled(); + done(); + }); + }); + + it('should return false and redirect to \\home if storage service returns true', (done) => { + storageService = new StorageService; + storageServiceSpy = spyOn(storageService,'get'); + router = TestBed.get(Router); + routerSpy = spyOn(router,'navigate'); + + storageServiceSpy.and.returnValue(Promise.resolve(true)); + router.initialNavigation(); + guard = new IndexGuard(storageService,router); + + guard.canActivate() + .then((resolve) => { + expect(resolve).toBeFalsy(); + expect(routerSpy).toHaveBeenCalledWith(['home']); + done(); + }); + }); + }); +}); \ No newline at end of file diff --git a/demo/ionic-dev/greenpeace/src/app/home/home-routing.module.ts b/demo/ionic-dev/greenpeace/src/app/home/home-routing.module.ts index 6c222c9..5baf7a0 100644 --- a/demo/ionic-dev/greenpeace/src/app/home/home-routing.module.ts +++ b/demo/ionic-dev/greenpeace/src/app/home/home-routing.module.ts @@ -5,7 +5,7 @@ import { HomePage } from './home.page'; import { HomeGuard } from '../guards/home.guard'; import { UserDataResolver } from '../resolvers/userData.resolver'; -const routes: Routes = [ +export const routes: Routes = [ { path: '', component: HomePage, diff --git a/demo/ionic-dev/greenpeace/src/app/home/home.page.html b/demo/ionic-dev/greenpeace/src/app/home/home.page.html index 19e7e2e..0d2afa6 100644 --- a/demo/ionic-dev/greenpeace/src/app/home/home.page.html +++ b/demo/ionic-dev/greenpeace/src/app/home/home.page.html @@ -7,7 +7,7 @@ - Course Managment + Course Management diff --git a/demo/ionic-dev/greenpeace/src/app/home/home.page.spec.ts b/demo/ionic-dev/greenpeace/src/app/home/home.page.spec.ts index 1615f4f..9f9965b 100644 --- a/demo/ionic-dev/greenpeace/src/app/home/home.page.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/home/home.page.spec.ts @@ -1,3 +1,10 @@ +/* +- a page with 3 tabs +- each tab has a name +- the tab is at the bottom of the page +- each tab button has an icon +- each tab button has a label +*/ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { RouterTestingModule } from "@angular/router/testing"; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; @@ -5,6 +12,7 @@ import { IonicModule } from '@ionic/angular'; import { HomePage } from './home.page'; import { HomeGuard } from '../guards/home.guard'; +import { element } from 'protractor'; describe('HomePage', () => { let component: HomePage; @@ -22,8 +30,138 @@ describe('HomePage', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + it('should have an tag', () => { + expect(fixture.nativeElement.querySelector('ion-tabs')).toBeTruthy(); + }); + + it('should have an tag', () => { + expect(fixture.nativeElement.querySelector('ion-tab-bar')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-tab-button')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-icon')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-label')).toBeTruthy(); + }); + + describe('', () => { + it('should have a slot property', () => { + expect(fixture.nativeElement.querySelector('ion-tab-bar').slot).toBeTruthy(); + }); + + it('should have a bottom slot', () => { + expect(fixture.nativeElement.querySelector('ion-tab-bar').slot).toBe("bottom"); + }); + + it('should have elements as children',() => { + for (let element of fixture.nativeElement.querySelector('ion-tab-bar').children) { + expect(element.tagName).toBe('ION-TAB-BUTTON'); + } + }); + + it('should have 3 tab buttons', () => { + expect(fixture.nativeElement.querySelector('ion-tab-bar').children.length).toEqual(3); + }); + }); + + describe('Dashboard ', () => { + it('should have a tab property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].tab).toBeTruthy(); + }); + + it('should have the tab property with a value "dashboard"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].tab).toBe("dashboard"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].children[0].tagName).toBe("ION-ICON"); + }); + + it('should have an child with a name property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].children[0].name).toBeTruthy(); + }); + + it('should have an child with a name property set to "briefcase"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].children[0].name).toBe("briefcase"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].children[1].tagName).toBe("ION-LABEL"); + }); + + it('should have an child with the text "Dashboard"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[0].children[1].textContent).toBe("Dashboard"); + }); + }); + + describe('Course Management ', () => { + it('should have a tab property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].tab).toBeTruthy(); + }); + + it('should have the tab property with a value "dashboard"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].tab).toBe("course-management"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].children[0].tagName).toBe("ION-ICON"); + }); + + it('should have an child with a name property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].children[0].name).toBeTruthy(); + }); + + it('should have an child with a name property set to "document"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].children[0].name).toBe("document"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].children[1].tagName).toBe("ION-LABEL"); + }); + + it('should have an child with the text "Course Management"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[1].children[1].textContent).toBe("Course Management"); + }); + }); + + describe('Settings ', () => { + it('should have a tab property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].tab).toBeTruthy(); + }); + + it('should have the tab property with a value "setings"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].tab).toBe("settings"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].children[0].tagName).toBe("ION-ICON"); + }); + + it('should have an child with a name property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].children[0].name).toBeTruthy(); + }); + + it('should have an child with a name property set to "settings"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].children[0].name).toBe("settings"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].children[1].tagName).toBe("ION-LABEL"); + }); + + it('should have an child with the text "Settings"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-tab-button')[2].children[1].textContent).toBe("Settings"); + }); + }); }); + diff --git a/demo/ionic-dev/greenpeace/src/app/index/index.page.spec.ts b/demo/ionic-dev/greenpeace/src/app/index/index.page.spec.ts index 852e754..8b8bbcb 100644 --- a/demo/ionic-dev/greenpeace/src/app/index/index.page.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/index/index.page.spec.ts @@ -20,7 +20,15 @@ describe('IndexPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-content')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('router-outlet')).toBeTruthy(); + }); }); diff --git a/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.html b/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.html index 550cc95..88fe225 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.html +++ b/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.html @@ -3,7 +3,3 @@ Course Management - - - - diff --git a/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.spec.ts b/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.spec.ts index 93760e2..2195aaf 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/pages/course-management/course-management.page.spec.ts @@ -18,7 +18,29 @@ describe('CourseManagementPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + + it('should have a ngOnInit() function', () => { + expect(component.ngOnInit).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-header')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-toolbar')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-title')).toBeTruthy(); + }); + + describe('', () => { + it('should have the text "Course Management"', () => { + expect(fixture.nativeElement.querySelector('ion-title').textContent).toBe("Course Management"); + }); + }) }); diff --git a/demo/ionic-dev/greenpeace/src/app/pages/dashboard/dashboard.page.spec.ts b/demo/ionic-dev/greenpeace/src/app/pages/dashboard/dashboard.page.spec.ts index 0ad0fda..f55032a 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/dashboard/dashboard.page.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/pages/dashboard/dashboard.page.spec.ts @@ -5,6 +5,7 @@ import { IonicModule } from '@ionic/angular'; import { DashboardPage } from './dashboard.page'; import { AuthService } from 'src/app/services/auth.service'; +import { BehaviorSubject } from 'rxjs'; describe('DashboardPage', () => { let component: DashboardPage; @@ -22,7 +23,77 @@ describe('DashboardPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + + it('should have an ngOnInit() function', () => { + expect(component.ngOnInit).toBeTruthy(); + }); + + it('should have a displayUserData property', () => { + expect(component.displayUserData).toBeTruthy; + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-header')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-toolbar')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-content')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-item')).toBeTruthy(); + }); + + it('should have at least one

tag', () => { + expect(fixture.nativeElement.querySelector('h2')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-title')).toBeTruthy(); + }); + + + describe('displayUserData', () => { + it('should be empty before ngOnInit() is called', () => { + expect(component.displayUserData).toBe(''); + }); + + let authService: AuthService; + it('should be empty before ngOnInit() is called', (done) => { + authService = TestBed.get(AuthService); + authService.userData$ = new BehaviorSubject({name: "Andy"}); + component.ngOnInit(); + expect(component.displayUserData).toEqual({name: "Andy"}); + done(); + }); + }); + + describe('

', () => { + it('should have the text "Hello, " before ngOnInit() is called', () => { + expect(fixture.nativeElement.querySelector('h2').textContent).toBe("Hello, "); + }); + + let authService: AuthService; + it('should have the text "Hello, Andy" after ngOnInit() is called with authService.userData$ = {name: "Andy"}', (done) => { + authService = TestBed.get(AuthService); + authService.userData$ = new BehaviorSubject({name: "Andy"}); + component.ngOnInit(); + fixture.detectChanges(); + expect(fixture.nativeElement.querySelector('h2').textContent).toBe("Hello, Andy"); + done(); + }); + }); + + describe('', () => { + it('should contain the text "Dashboard"', () => { + expect(fixture.nativeElement.querySelector('ion-title').textContent).toBe('Dashboard'); + }); + }); }); diff --git a/demo/ionic-dev/greenpeace/src/app/pages/settings/settings.page.spec.ts b/demo/ionic-dev/greenpeace/src/app/pages/settings/settings.page.spec.ts index 1d576bb..f52ced9 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/settings/settings.page.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/pages/settings/settings.page.spec.ts @@ -22,7 +22,73 @@ describe('SettingsPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + + it('should have a logoutAction() function', () => { + expect(component.logoutAction).toBeTruthy(); + }); + + it('should have a ngOnInit() function', () => { + expect(component.ngOnInit).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-header')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-toolbar')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-content')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-button')).toBeTruthy(); + }); + + it('should have at least one tag', () => { + expect(fixture.nativeElement.querySelector('ion-title')).toBeTruthy(); + }); + + describe('', () => { + it('should have the text "Settings"', () => { + expect(fixture.nativeElement.querySelector('ion-title').textContent).toBe('Settings'); + }); + }); + + describe('', () => { + it('should have the text "Sign Out"', () => { + expect(fixture.nativeElement.querySelector('ion-button').textContent).toBe('Sign Out'); + }); + + it('should have an expand property', () => { + expect(fixture.nativeElement.querySelector('ion-button').expand).toBeTruthy(); + }); + + it('should have an expand property set to block', () => { + expect(fixture.nativeElement.querySelector('ion-button').expand).toBe("block"); + }); + + it('should have click event', () => { + expect(fixture.nativeElement.querySelector('ion-button').click).toBeTruthy(); + }); + + + it('should call logoutAction() when clicked', () => { + let spy = spyOn(component,'logoutAction'); + fixture.nativeElement.querySelector('ion-button').click(); + expect(component.logoutAction).toHaveBeenCalled(); + }); + }); + + describe('logoutAction()', () => { + it('should not be called if the button has not been clicked', () => { + let spy = spyOn(component,'logoutAction'); + expect(component.logoutAction).not.toHaveBeenCalled(); + }); + }); }); diff --git a/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.html b/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.html index 95b062e..dde5318 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.html +++ b/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.html @@ -26,4 +26,4 @@ Sign In with Moodle - + \ No newline at end of file diff --git a/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.spec.ts b/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.spec.ts index bc49cb3..8cfbdac 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.spec.ts +++ b/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.spec.ts @@ -6,6 +6,10 @@ import { IonicModule } from '@ionic/angular'; import { SignInPage } from './signin.page'; import { AuthService } from 'src/app/services/auth.service'; +import { of, throwError } from 'rxjs'; +import { ToastService } from 'src/app/services/toast.service'; +import { StorageService } from 'src/app/services/storage.service'; +import { Router } from '@angular/router'; describe('SignInPage', () => { let component: SignInPage; @@ -24,7 +28,337 @@ describe('SignInPage', () => { fixture.detectChanges(); })); - it('should create', () => { + it('should be created', () => { expect(component).toBeTruthy(); }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-header')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-toolbar')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-title')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-content')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('app-logo')).toBeTruthy(); + }); + + it('should have at least one
', () => { + expect(fixture.nativeElement.querySelector('form')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-list')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-item')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-label')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-input')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('a')).toBeTruthy(); + }); + + it('should have at least one ', () => { + expect(fixture.nativeElement.querySelector('ion-button')).toBeTruthy(); + }); + + describe('Wits Email ', () => { + it('should have a child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[0].tagName).toBe('ION-LABEL'); + }); + + it('should have an child with a position property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[0].position).toBeTruthy(); + }); + + it('should have an child with a position property set to "stacked"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[0].position).toBe('stacked'); + }); + + it('should have an child with the text "Wits Email"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[0].textContent).toBe('Wits Email'); + }); + + it('should have a child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].tagName).toBe('ION-INPUT'); + }); + + it('should have an child with a type property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].type).toBeTruthy(); + }); + + it('should have an child with a name property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].name).toBeTruthy(); + }); + + it('should have an child with a name property set to "witsemail"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].name).toBe('witsemail'); + }); + + it('should have an child with no text initially"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].textContent).toBe(''); + }); + + it('should have an child with an ngModel binding"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].ngModel).toBeDefined(); + }); + + it('should have an child with an ngModel binding to set postData.witsemail"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[0].children[1].ngModel).toBe(""); + }); + }); + + describe('Password ', () => { + it('should have a child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[0].tagName).toBe('ION-LABEL'); + }); + + it('should have an child with a position property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[0].position).toBeTruthy(); + }); + + it('should have an child with a position property set to "stacked"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[0].position).toBe('stacked'); + }); + + it('should have an child with the text "Password"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[0].textContent).toBe('Password'); + }); + + it('should have a child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].tagName).toBe('ION-INPUT'); + }); + + it('should have an child with a type property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].type).toBeTruthy(); + }); + + it('should have an child with a name property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].name).toBeTruthy(); + }); + + it('should have an child with a name property set to "password"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].name).toBe('password'); + }); + + it('should have an child with no text initially"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].textContent).toBe(''); + }); + + it('should have an child with an ngModel binding"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].ngModel).toBeDefined(); + }); + + it('should have an child with an ngModel binding to set postData.password"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[1].children[1].ngModel).toBe(""); + }); + }); + + describe('Forgotten password ', () => { + it('should have a lines property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[2].lines).toBeTruthy(); + }); + + it('should have a lines property set to none', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[2].lines).toBe("none"); + }); + + it('should have an child', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[2].children[0].tagName).toBe('A'); + }); + + it('should have an child with an href property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[2].children[0].href).toBeTruthy(); + }); + + it('should have an child with the text "Have you forgotten your password?"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-item')[2].children[0].textContent).toBe('Have you forgotten your password?'); + }); + }); + + describe('Sign in ', () => { + it('should have an expand property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[0].expand).toBeTruthy(); + }); + + it('should have an expand property set to block', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[0].expand).toBe('block'); + }); + + it('should have the text "Sign In"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[0].textContent).toBe("Sign In"); + }); + + it('should have a click event', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[0].click).toBeTruthy(); + }); + + it('should call loginAction() when clicked', () => { + let spy = spyOn(component,'loginAction'); + fixture.nativeElement.getElementsByTagName('ion-button')[0].click(); + expect(component.loginAction).toHaveBeenCalled(); + }); + }); + + describe('Sign in with Moodle ', () => { + it('should have an expand property', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[1].expand).toBeTruthy(); + }); + + it('should have an expand property set to block', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[1].expand).toBe('block'); + }); + + it('should have the text "Sign In with Moodle"', () => { + expect(fixture.nativeElement.getElementsByTagName('ion-button')[1].textContent).toBe("Sign In with Moodle"); + }); + }); + + it('should have a validateInputs() function', () => { + expect(component.validateInputs).toBeTruthy(); + }); + + it('should have a loginAction() function', () => { + expect(component.loginAction).toBeTruthy(); + }); + + describe('validateInputs()', () => { + it('should return false if there was no password input and no email input', () => { + expect(component.validateInputs()).toBeFalsy(); + }); + + it('should return false if there was no password input and there is email input', () => { + component.postData.witsemail = 'something'; + expect(component.validateInputs()).toBeFalsy(); + }); + + it('should return false if there was password input but there is no email input', () => { + component.postData.password = 'something'; + expect(component.validateInputs()).toBeFalsy(); + }); + + it('should return true if there was password input and email input', () => { + component.postData.password = 'something'; + component.postData.witsemail = 'something'; + expect(component.validateInputs()).toBeTruthy(); + }); + }); + + describe('loginAction()', () => { + it('should call authService.signin() if validateInputs() is true', (done) => { + let authService = TestBed.get(AuthService); + spyOn(component,'validateInputs').and.returnValue(true); + spyOn(authService,'signin').and.returnValue(of('')); + component.loginAction(); + expect(authService.signin).toHaveBeenCalled(); + done(); + }); + + it('should call toastService.presentToast() with the text "Incorrect username or password" if validateInputs() is true but the response from authService.signin() is an error', (done) => { + let authService = TestBed.get(AuthService); + let toastService = TestBed.get(ToastService); + spyOn(toastService,'presentToast'); + spyOn(component,'validateInputs').and.returnValue(true); + spyOn(authService,'signin').and.returnValue(of({error: true})); + component.loginAction(); + expect(toastService.presentToast).toHaveBeenCalledWith("Incorrect username or password"); + done(); + }); + + it('should call storageService.store() if validateInputs() is true but the response from authService.signin() is not an error', (done) => { + let authService = TestBed.get(AuthService); + let storageService = TestBed.get(StorageService); + spyOn(storageService,'store'); + spyOn(component,'validateInputs').and.returnValue(true); + spyOn(authService,'signin').and.returnValue(of({error: false})); + component.loginAction(); + expect(storageService.store).toHaveBeenCalled(); + done(); + }); + + it('should change the route to \\home if validateInputs() is true but the response from authService.signin() is not an error', (done) => { + let authService = TestBed.get(AuthService); + let router = TestBed.get(Router); + spyOn(component,'validateInputs').and.returnValue(true); + spyOn(authService,'signin').and.returnValue(of({error: false})); + spyOn(router,'navigate'); + component.loginAction(); + expect(router.navigate).toHaveBeenCalledWith(['home']); + done(); + }); + + it('should call toastService.presentToast() with the text "Network connection error." if validateInputs() is true but authService.signin() is could not contact the server', (done) => { + let authService = TestBed.get(AuthService); + let toastService = TestBed.get(ToastService); + spyOn(toastService,'presentToast'); + spyOn(authService,'signin').and.returnValue(throwError({})); + spyOn(component,'validateInputs').and.returnValue(true); + component.loginAction(); + expect(toastService.presentToast).toHaveBeenCalledWith("Network connection error."); + done(); + }); + + it('should call toastService.presentToast() if validateInputs() is false', (done) => { + let toastService = TestBed.get(ToastService); + spyOn(component,'validateInputs').and.returnValue(false); + spyOn(toastService,'presentToast'); + component.loginAction(); + expect(toastService.presentToast).toHaveBeenCalled(); + done(); + }); + + it('should present a toast with the message "Please enter a wits email address and password." if no password and no email were entered', (done) => { + let toastService = TestBed.get(ToastService); + spyOn(toastService,'presentToast'); + spyOn(component,'validateInputs').and.returnValue(false); + component.loginAction(); + expect(toastService.presentToast).toHaveBeenCalledWith("Please enter a wits email address and password."); + done(); + }); + + it('should present a toast with the message "Please enter a password." if no password was entered', (done) => { + let toastService = TestBed.get(ToastService); + spyOn(toastService,'presentToast'); + spyOn(component,'validateInputs').and.returnValue(false); + component.postData.witsemail = 'something' + component.loginAction(); + expect(toastService.presentToast).toHaveBeenCalledWith("Please enter a password."); + done(); + }); + + it('should present a toast with the message "Please enter a wits email address." if no email address was entered', (done) => { + let toastService = TestBed.get(ToastService); + spyOn(toastService,'presentToast'); + spyOn(component,'validateInputs').and.returnValue(false); + component.postData.password = 'something' + component.loginAction(); + expect(toastService.presentToast).toHaveBeenCalledWith("Please enter a wits email address."); + done(); + }); + + it('should be called if the Sign In button is clicked', (done) => { + spyOn(component,'loginAction'); + fixture.nativeElement.getElementsByTagName('ion-button')[0].click(); + expect(component.loginAction).toHaveBeenCalled(); + done(); + }); + }); }); diff --git a/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.ts b/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.ts index 153059e..eb3fb28 100644 --- a/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.ts +++ b/demo/ionic-dev/greenpeace/src/app/pages/signin/signin.page.ts @@ -46,11 +46,11 @@ export class SignInPage implements OnInit { this.router.navigate(['home']); } else { - this.toastService.presentToast("Incorrect username or password"); + this.toastService.presentToast("Incorrect username or password"); } }, (error: any) => { - this.toastService.presentToast("Network connection error.") + this.toastService.presentToast("Network connection error.") }) } else {