From c3c17f2c1be0c5a330044b073355e8b262e422d7 Mon Sep 17 00:00:00 2001 From: Daniel Florian Date: Thu, 7 Jun 2018 17:50:35 -0500 Subject: [PATCH] Fixes to tests due to the upgrade to PatternFly-NG --- src/main/ngapp/package-lock.json | 222 +++++++++--------- .../dataservices.component.spec.ts | 1 - .../view-card/view-card.component.spec.ts | 25 +- .../view-cards/view-cards.component.spec.ts | 25 +- .../connection-table-dialog.component.spec.ts | 26 +- ...connection-tree-selector.component.spec.ts | 50 ++-- .../editor-views.component.spec.ts | 35 ++- .../message-log/message-log.component.spec.ts | 45 +++- .../view-preview.component.spec.ts | 43 +++- .../view-canvas/view-canvas.component.spec.ts | 38 ++- .../view-editor-header.component.spec.ts | 20 +- .../view-editor/view-editor.component.spec.ts | 40 +++- .../view-editor/view-editor.service.spec.ts | 17 +- .../virtualization.component.spec.ts | 28 ++- 14 files changed, 441 insertions(+), 174 deletions(-) diff --git a/src/main/ngapp/package-lock.json b/src/main/ngapp/package-lock.json index 2b49145..3c21c2c 100644 --- a/src/main/ngapp/package-lock.json +++ b/src/main/ngapp/package-lock.json @@ -43,44 +43,44 @@ "ember-cli-string-utils": "^1.0.0", "exports-loader": "^0.6.3", "extract-text-webpack-plugin": "3.0.0", - "file-loader": "0.10.1", - "fs-extra": "4.0.2", - "get-caller-file": "1.0.2", - "glob": "7.1.2", - "heimdalljs": "0.2.5", - "heimdalljs-logger": "0.1.9", - "html-webpack-plugin": "2.30.1", - "inflection": "1.12.0", - "inquirer": "3.3.0", - "isbinaryfile": "3.0.2", - "istanbul-instrumenter-loader": "2.0.0", - "karma-source-map-support": "1.2.0", - "less": "2.7.2", - "less-loader": "4.0.5", - "license-webpack-plugin": "0.5.1", - "lodash": "4.17.10", - "memory-fs": "0.4.1", - "minimatch": "3.0.4", - "node-modules-path": "1.0.1", - "node-sass": "4.5.3", - "nopt": "4.0.1", - "opn": "5.1.0", - "portfinder": "1.0.13", - "postcss-loader": "1.3.3", - "postcss-url": "5.1.2", - "raw-loader": "0.5.1", - "resolve": "1.4.0", - "rsvp": "3.6.2", - "rxjs": "5.5.6", - "sass-loader": "6.0.6", - "script-loader": "0.7.1", - "semver": "5.4.1", - "silent-error": "1.1.0", - "source-map-loader": "0.2.1", - "source-map-support": "0.4.18", - "style-loader": "0.13.2", - "stylus": "0.54.5", - "stylus-loader": "3.0.1", + "file-loader": "^0.10.0", + "fs-extra": "^4.0.0", + "get-caller-file": "^1.0.0", + "glob": "^7.0.3", + "heimdalljs": "^0.2.4", + "heimdalljs-logger": "^0.1.9", + "html-webpack-plugin": "^2.29.0", + "inflection": "^1.7.0", + "inquirer": "^3.0.0", + "isbinaryfile": "^3.0.0", + "istanbul-instrumenter-loader": "^2.0.0", + "karma-source-map-support": "^1.2.0", + "less": "^2.7.2", + "less-loader": "^4.0.5", + "license-webpack-plugin": "^0.5.1", + "lodash": "^4.11.1", + "memory-fs": "^0.4.1", + "minimatch": "^3.0.3", + "node-modules-path": "^1.0.0", + "node-sass": "^4.3.0", + "nopt": "^4.0.1", + "opn": "~5.1.0", + "portfinder": "~1.0.12", + "postcss-loader": "^1.3.3", + "postcss-url": "^5.1.2", + "raw-loader": "^0.5.1", + "resolve": "^1.1.7", + "rsvp": "^3.0.17", + "rxjs": "^5.4.2", + "sass-loader": "^6.0.3", + "script-loader": "^0.7.0", + "semver": "^5.1.0", + "silent-error": "^1.0.0", + "source-map-loader": "^0.2.0", + "source-map-support": "^0.4.1", + "style-loader": "^0.13.1", + "stylus": "^0.54.5", + "stylus-loader": "^3.0.1", "temp": "0.8.3", "typescript": ">=2.0.0 <2.5.0", "url-loader": "^0.5.7", @@ -352,8 +352,8 @@ "resolved": "https://registry.npmjs.org/angular-tree-component/-/angular-tree-component-7.2.0.tgz", "integrity": "sha512-xUQvY18WjA8SqNlhDVPWVK0UyPSv2biCRGVrfRiFXEDJQAevLKiXJkw/awTa2mfH/4cuJhmjZuDGXubpcj6Tvw==", "requires": { - "lodash": "4.17.10", - "mobx": "3.6.2", + "lodash": "^4.17.5", + "mobx": "^3.6.2", "mobx-angular": "2.1.1" } }, @@ -550,7 +550,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", "requires": { - "lodash": "4.17.10" + "lodash": "^4.14.0" } }, "async-each": { @@ -632,14 +632,14 @@ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.6", + "trim-right": "^1.0.1" }, "dependencies": { "jsesc": { @@ -671,11 +671,11 @@ "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.10" + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" } }, "babel-traverse": { @@ -683,15 +683,15 @@ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.10" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" } }, "babel-types": { @@ -699,10 +699,10 @@ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { @@ -1323,7 +1323,7 @@ "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", "dev": true, "requires": { - "lodash": "4.17.10" + "lodash": "^4.5.0" } }, "combined-stream": { @@ -3741,9 +3741,9 @@ "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", "optional": true, "requires": { - "glob": "7.1.2", - "lodash": "4.17.10", - "minimatch": "3.0.4" + "glob": "~7.1.1", + "lodash": "~4.17.4", + "minimatch": "~3.0.2" } }, "graceful-fs": { @@ -4014,12 +4014,12 @@ "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-2.30.1.tgz", "integrity": "sha1-f5xCG36pHsRg9WUn1430hO51N9U=", "requires": { - "bluebird": "3.5.0", - "html-minifier": "3.5.5", - "loader-utils": "0.2.17", - "lodash": "4.17.10", - "pretty-error": "2.1.1", - "toposort": "1.0.4" + "bluebird": "^3.4.7", + "html-minifier": "^3.2.3", + "loader-utils": "^0.2.16", + "lodash": "^4.17.3", + "pretty-error": "^2.0.2", + "toposort": "^1.0.0" }, "dependencies": { "loader-utils": { @@ -4098,10 +4098,10 @@ "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz", "integrity": "sha1-ZC6ISIUdZvCdTxJJEoRtuutBuDM=", "requires": { - "http-proxy": "1.16.2", - "is-glob": "3.1.0", - "lodash": "4.17.10", - "micromatch": "2.3.11" + "http-proxy": "^1.16.2", + "is-glob": "^3.1.0", + "lodash": "^4.17.2", + "micromatch": "^2.3.11" }, "dependencies": { "is-extglob": { @@ -4261,13 +4261,13 @@ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "requires": { - "ansi-escapes": "3.0.0", - "chalk": "2.1.0", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.0.5", - "figures": "2.0.0", - "lodash": "4.17.10", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", "mute-stream": "0.0.7", "run-async": "^2.2.0", "rx-lite": "^4.0.8", @@ -5039,8 +5039,8 @@ "integrity": "sha1-0jyjSAG9qYY60xjju0vUBisTrNI=", "dev": true, "requires": { - "lodash": "4.17.10", - "phantomjs-prebuilt": "2.1.15" + "lodash": "^4.0.1", + "phantomjs-prebuilt": "^2.1.7" } }, "karma-source-map-support": { @@ -5601,19 +5601,19 @@ "integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=", "optional": true, "requires": { - "fstream": "1.0.11", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "npmlog": "4.1.2", - "osenv": "0.1.5", - "request": "2.83.0", - "rimraf": "2.6.2", - "semver": "5.3.0", - "tar": "2.2.1", - "which": "1.3.0" + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "2", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" }, "dependencies": { "nopt": { @@ -5751,8 +5751,8 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "normalize-package-data": { @@ -7732,10 +7732,10 @@ "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", "optional": true, "requires": { - "glob": "7.1.2", - "lodash": "4.17.10", - "scss-tokenizer": "0.2.3", - "yargs": "7.1.0" + "glob": "^7.0.0", + "lodash": "^4.0.0", + "scss-tokenizer": "^0.2.3", + "yargs": "^7.0.0" } }, "sass-loader": { @@ -9451,7 +9451,7 @@ "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.0.tgz", "integrity": "sha1-atciI7PguDflMeRZfBmfkJNhUR4=", "requires": { - "lodash": "4.17.10" + "lodash": "^4.17.4" } }, "webpack-sources": { @@ -9593,7 +9593,7 @@ "resolved": "https://registry.npmjs.org/x2js/-/x2js-3.2.1.tgz", "integrity": "sha512-+6gQGmMKbAHmapedjI/r+cPQNdFqQ0OE1VJvv3A6GPVlEJAsFq9JyNVgfwgnceMiUtpt38VOUEtEF7S3SxZkMQ==", "requires": { - "xmldom": "0.1.27" + "xmldom": "^0.1.19" } }, "xml-char-classes": { diff --git a/src/main/ngapp/src/app/dataservices/dataservices.component.spec.ts b/src/main/ngapp/src/app/dataservices/dataservices.component.spec.ts index b561a99..03ee774 100644 --- a/src/main/ngapp/src/app/dataservices/dataservices.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/dataservices.component.spec.ts @@ -74,7 +74,6 @@ describe("DataservicesComponent", () => { OdataControlComponent, ViewsContentComponent ], providers: [ - AppSettingsService, NotifierService, SelectionService, WizardService, diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-card/view-card.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-card/view-card.component.spec.ts index 71d5f20..094bdc0 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-card/view-card.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-card/view-card.component.spec.ts @@ -1,7 +1,16 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ViewCardComponent } from './view-card.component'; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; import { RouterTestingModule } from "@angular/router/testing"; import { LoggerService } from "@core/logger.service"; import { View } from "@dataservices//shared/view.model"; @@ -14,14 +23,24 @@ describe('ViewCardComponent', () => { TestBed.configureTestingModule({ declarations: [ ViewCardComponent ], imports: [ - PatternFlyNgModule, + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, RouterTestingModule ], providers: [ LoggerService ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-cards.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-cards.component.spec.ts index 4eff5d9..d5480bc 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-cards.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-cards/view-cards.component.spec.ts @@ -3,7 +3,16 @@ import { RouterTestingModule } from "@angular/router/testing"; import { LoggerService } from "@core/logger.service"; import { ViewCardsComponent } from "@dataservices/virtualization/view-cards/view-cards.component"; import { ViewCardComponent } from "@dataservices/virtualization/view-cards/view-card/view-card.component"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; describe('ViewCardsComponent', () => { let component: ViewCardsComponent; @@ -16,14 +25,24 @@ describe('ViewCardsComponent', () => { ViewCardComponent ], imports: [ - PatternFlyNgModule, + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, RouterTestingModule ], providers: [ LoggerService ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-table-dialog.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-table-dialog.component.spec.ts index c097078..c7a7a5e 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-table-dialog.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-table-dialog.component.spec.ts @@ -4,7 +4,16 @@ import { ConnectionTableDialogComponent } from "./connection-table-dialog.compon import { ConnectionTreeSelectorComponent } from "@dataservices/virtualization/view-editor/connection-table-dialog/connection-tree-selector/connection-tree-selector.component"; import { TreeModule } from "angular-tree-component"; import { HttpModule } from "@angular/http"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; import { BsModalRef, ModalModule } from "ngx-bootstrap"; import { ConnectionService } from "@connections/shared/connection.service"; import { MockConnectionService } from "@connections/shared/mock-connection.service"; @@ -20,7 +29,20 @@ describe("ConnectionTableDialogComponent", () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ HttpModule, PatternFlyNgModule, TreeModule, ModalModule.forRoot() ], + imports: [ + HttpModule, + TreeModule, + ModalModule.forRoot(), + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule + ], declarations: [ ConnectionTableDialogComponent, ConnectionTreeSelectorComponent ], providers: [ AppSettingsService, BsModalRef, LoggerService, NotifierService, { provide: ConnectionService, useClass: MockConnectionService }, diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-tree-selector/connection-tree-selector.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-tree-selector/connection-tree-selector.component.spec.ts index c4cacfa..e597e01 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-tree-selector/connection-tree-selector.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/connection-table-dialog/connection-tree-selector/connection-tree-selector.component.spec.ts @@ -32,31 +32,31 @@ describe("ConnectionTreeSelectorComponent", () => { fixture = TestBed.createComponent(ConnectionTreeSelectorComponent); component = fixture.componentInstance; - const node = { - "connectionName": "pgConn", - "name": "restaurants", - "type": "collection", - "queryable": true, - "children": [ - { - "connectionName": "pgConn", - "name": "grades", - "type": "embedded", - "queryable": true, - "children": [] - }, - { - "connectionName": "pgConn", - "name": "location", - "type": "embedded", - "queryable": true, - "children": [] - } - ] - }; - - component.nodes = [ SchemaNode.create( node ) ]; - component.options = {}; + // const node = { + // "connectionName": "pgConn", + // "name": "restaurants", + // "type": "collection", + // "queryable": true, + // "children": [ + // { + // "connectionName": "pgConn", + // "name": "grades", + // "type": "embedded", + // "queryable": true, + // "children": [] + // }, + // { + // "connectionName": "pgConn", + // "name": "location", + // "type": "embedded", + // "queryable": true, + // "children": [] + // } + // ] + // }; + // + // component.nodes = [ SchemaNode.create( node ) ]; + // component.options = {}; fixture.detectChanges(); }); diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/editor-views.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/editor-views.component.spec.ts index c33b04b..c493e06 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/editor-views.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/editor-views.component.spec.ts @@ -1,11 +1,26 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { HttpModule } from "@angular/http"; import { LoggerService } from "@core/logger.service"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { AppSettingsService } from "@core/app-settings.service"; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; import { ViewEditorService } from "@dataservices/virtualization/view-editor/view-editor.service"; import { EditorViewsComponent } from '@dataservices/virtualization/view-editor/editor-views/editor-views.component'; import { MessageLogComponent } from "@dataservices/virtualization/view-editor/editor-views/message-log/message-log.component"; import { ViewPreviewComponent } from "@dataservices/virtualization/view-editor/editor-views/view-preview/view-preview.component"; import { TabsModule } from "ngx-bootstrap"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; describe('EditorViewsComponent', () => { let component: EditorViewsComponent; @@ -14,7 +29,16 @@ describe('EditorViewsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ - PatternFlyNgModule, + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, + HttpModule, TabsModule.forRoot() ], declarations: [ @@ -23,11 +47,16 @@ describe('EditorViewsComponent', () => { ViewPreviewComponent ], providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, LoggerService, + NotifierService, + { provide: VdbService, useClass: MockVdbService }, ViewEditorService ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/message-log/message-log.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/message-log/message-log.component.spec.ts index 4798e2e..9224d9b 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/message-log/message-log.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/message-log/message-log.component.spec.ts @@ -1,9 +1,23 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MessageLogComponent } from './message-log.component'; -import { PatternFlyNgModule } from "patternfly-ng"; +import { HttpModule } from "@angular/http"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { AppSettingsService } from "@core/app-settings.service"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; import { LoggerService } from "@core/logger.service"; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; import { ViewEditorService } from "@dataservices/virtualization/view-editor/view-editor.service"; +import { MessageLogComponent } from '@dataservices/virtualization/view-editor/editor-views/message-log/message-log.component'; describe('MessageLogComponent', () => { let component: MessageLogComponent; @@ -11,11 +25,30 @@ describe('MessageLogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ PatternFlyNgModule ], + imports: [ + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, + HttpModule + ], declarations: [ MessageLogComponent ], - providers: [ LoggerService, ViewEditorService ] + providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, + LoggerService, + NotifierService, + { provide: VdbService, useClass: MockVdbService }, + ViewEditorService + ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/view-preview/view-preview.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/view-preview/view-preview.component.spec.ts index f60cabb..e281348 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/view-preview/view-preview.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/editor-views/view-preview/view-preview.component.spec.ts @@ -1,9 +1,24 @@ +import { HttpModule } from "@angular/http"; import { async, ComponentFixture, TestBed } from "@angular/core/testing"; import { RouterTestingModule } from "@angular/router/testing"; import { LoggerService } from "@core/logger.service"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { AppSettingsService } from "@core/app-settings.service"; import { ViewEditorService } from "@dataservices/virtualization/view-editor/view-editor.service"; import { ViewPreviewComponent } from "@dataservices/virtualization/view-editor/editor-views/view-preview/view-preview.component"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; describe("ViewPreviewComponent", () => { let component: ViewPreviewComponent; @@ -11,11 +26,31 @@ describe("ViewPreviewComponent", () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ PatternFlyNgModule, RouterTestingModule ], + imports: [ + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, + HttpModule, + RouterTestingModule + ], declarations: [ ViewPreviewComponent ], - providers: [ LoggerService, ViewEditorService ] + providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, + LoggerService, + NotifierService, + { provide: VdbService, useClass: MockVdbService }, + ViewEditorService + ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-canvas/view-canvas.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-canvas/view-canvas.component.spec.ts index ea8b8e6..3e8f87d 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-canvas/view-canvas.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-canvas/view-canvas.component.spec.ts @@ -1,10 +1,24 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - +import { HttpModule } from "@angular/http"; import { LoggerService } from "@core/logger.service"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { AppSettingsService } from "@core/app-settings.service"; import { SelectedNodeComponent } from "@dataservices/selected-node/selected-node.component"; import { ViewCanvasComponent } from '@dataservices/virtualization/view-editor/view-canvas/view-canvas.component'; import { ViewEditorService } from "@dataservices/virtualization/view-editor/view-editor.service"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; describe('ViewCanvasComponent', () => { let component: ViewCanvasComponent; @@ -12,14 +26,30 @@ describe('ViewCanvasComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ PatternFlyNgModule ], + imports: [ + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, + HttpModule + ], declarations: [ ViewCanvasComponent, SelectedNodeComponent ], providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, LoggerService, + NotifierService, + { provide: VdbService, useClass: MockVdbService }, ViewEditorService ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor-header/view-editor-header.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor-header/view-editor-header.component.spec.ts index 22d60aa..bf12dd8 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor-header/view-editor-header.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor-header/view-editor-header.component.spec.ts @@ -1,9 +1,15 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { HttpModule } from "@angular/http"; import { FormsModule } from "@angular/forms"; import { RouterTestingModule } from "@angular/router/testing"; import { LoggerService } from "@core/logger.service"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { AppSettingsService } from "@core/app-settings.service"; import { ViewEditorService } from "@dataservices/virtualization/view-editor/view-editor.service"; import { ViewEditorHeaderComponent } from '@dataservices/virtualization/view-editor/view-editor-header/view-editor-header.component'; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; describe('ViewEditorHeaderComponent', () => { let component: ViewEditorHeaderComponent; @@ -11,9 +17,19 @@ describe('ViewEditorHeaderComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ FormsModule, RouterTestingModule ], + imports: [ + FormsModule, + HttpModule, + RouterTestingModule + ], declarations: [ ViewEditorHeaderComponent ], - providers: [ LoggerService, ViewEditorService ] + providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, + LoggerService, + NotifierService, + { provide: VdbService, useClass: MockVdbService }, + ViewEditorService + ] }) .compileComponents(); })); diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.component.spec.ts index fa22fa5..7796e72 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.component.spec.ts @@ -2,6 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from "@angular/forms"; import { RouterTestingModule } from "@angular/router/testing"; import { CoreModule } from "@core/core.module"; +import { AppSettingsService } from "@core/app-settings.service"; import { SelectionService } from "@core/selection.service"; import { SelectedNodeComponent } from "@dataservices/selected-node/selected-node.component"; import { ViewEditorComponent } from '@dataservices/virtualization/view-editor/view-editor.component'; @@ -14,7 +15,23 @@ import { ViewPreviewComponent } from "@dataservices/virtualization/view-editor/e import { ViewEditorHeaderComponent } from "@dataservices/virtualization/view-editor/view-editor-header/view-editor-header.component"; import { TreeModule } from "angular-tree-component"; import { TabsModule } from "ngx-bootstrap"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + ToolbarModule, + WizardModule } from "patternfly-ng"; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; +import { ConnectionService } from "@connections/shared/connection.service"; +import { MockConnectionService } from "@connections/shared/mock-connection.service"; describe('ViewEditorComponent', () => { let component: ViewEditorComponent; @@ -25,7 +42,16 @@ describe('ViewEditorComponent', () => { imports: [ CoreModule, FormsModule, - PatternFlyNgModule, + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + ToolbarModule, + WizardModule, RouterTestingModule, TabsModule.forRoot(), TreeModule @@ -42,10 +68,16 @@ describe('ViewEditorComponent', () => { ViewPreviewComponent ], providers: [ - SelectionService + { provide: AppSettingsService, useClass: MockAppSettingsService }, + { provide: ConnectionService, useClass: MockConnectionService }, + NotifierService, + SelectionService, + { provide: VdbService, useClass: MockVdbService } ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); })); beforeEach(() => { diff --git a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.service.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.service.spec.ts index 9fbb97d..bc18ea2 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.service.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/view-editor/view-editor.service.spec.ts @@ -1,13 +1,24 @@ import { TestBed, inject } from '@angular/core/testing'; - -import { ViewEditorService } from './view-editor.service'; +import { HttpModule } from "@angular/http"; import { LoggerService } from "@core/logger.service"; +import { AppSettingsService } from "@core/app-settings.service"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { VdbService } from "@dataservices/shared/vdb.service"; +import { MockVdbService } from "@dataservices/shared/mock-vdb.service"; +import { NotifierService } from "@dataservices/shared/notifier.service"; +import { ViewEditorService } from '@dataservices/virtualization/view-editor/view-editor.service'; -describe('ViewEditorSelectionService', () => { +describe('ViewEditorService', () => { beforeEach(() => { TestBed.configureTestingModule({ + imports: [ + HttpModule + ], providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, LoggerService, + NotifierService, + { provide: VdbService, useClass: MockVdbService }, ViewEditorService ] }); diff --git a/src/main/ngapp/src/app/dataservices/virtualization/virtualization.component.spec.ts b/src/main/ngapp/src/app/dataservices/virtualization/virtualization.component.spec.ts index b3bc594..cb05a90 100644 --- a/src/main/ngapp/src/app/dataservices/virtualization/virtualization.component.spec.ts +++ b/src/main/ngapp/src/app/dataservices/virtualization/virtualization.component.spec.ts @@ -2,6 +2,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { FormsModule, ReactiveFormsModule } from "@angular/forms"; import { RouterTestingModule } from "@angular/router/testing"; import { CoreModule } from "@core/core.module"; +import { MockAppSettingsService } from "@core/mock-app-settings.service"; +import { AppSettingsService } from "@core/app-settings.service"; import { SelectionService } from "@core/selection.service"; import { DataserviceService } from "@dataservices/shared/dataservice.service"; import { MockDataserviceService } from "@dataservices/shared/mock-dataservice.service"; @@ -12,7 +14,16 @@ import { VirtualizationComponent } from "@dataservices/virtualization/virtualiza import { ViewCardsComponent } from "@dataservices/virtualization/view-cards/view-cards.component"; import { ViewCardComponent } from "@dataservices/virtualization/view-cards/view-card/view-card.component"; import { PropertyFormPropertyComponent } from "@shared/property-form/property-form-property/property-form-property.component"; -import { PatternFlyNgModule } from "patternfly-ng"; +import { + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule } from "patternfly-ng"; describe("VirtualizationComponent", () => { let component: VirtualizationComponent; @@ -23,7 +34,15 @@ describe("VirtualizationComponent", () => { imports: [ CoreModule, FormsModule, - PatternFlyNgModule, + ActionModule, + CardModule, + EmptyStateModule, + FilterModule, + ListModule, + NotificationModule, + SortModule, + TableModule, + WizardModule, ReactiveFormsModule, RouterTestingModule ], @@ -34,13 +53,16 @@ describe("VirtualizationComponent", () => { VirtualizationComponent ], providers: [ + { provide: AppSettingsService, useClass: MockAppSettingsService }, { provide: DataserviceService, useClass: MockDataserviceService }, NotifierService, SelectionService, { provide: VdbService, useClass: MockVdbService } ] }) - .compileComponents(); + .compileComponents().then(() => { + // nothing to do + }); }); beforeEach(() => {