diff --git a/src/app/project-map/project-map-shortcuts/project-map-shortcuts.component.spec.ts b/src/app/project-map/project-map-shortcuts/project-map-shortcuts.component.spec.ts index 2b611a23..7a1ef6d7 100644 --- a/src/app/project-map/project-map-shortcuts/project-map-shortcuts.component.spec.ts +++ b/src/app/project-map/project-map-shortcuts/project-map-shortcuts.component.spec.ts @@ -7,10 +7,7 @@ import { HotkeyModule, HotkeysService, Hotkey } from "angular2-hotkeys"; import { Observable } from "rxjs"; import { ProjectMapShortcutsComponent } from './project-map-shortcuts.component'; -import { - ToasterService, - MockedToasterService -} from "../../shared/services/toaster.service"; +import { ToasterService, } from "../../shared/services/toaster.service"; import { NodeService } from "../../shared/services/node.service"; import { HttpServer } from "../../shared/services/http-server.service"; import { SelectionManager } from "../../cartography/shared/managers/selection-manager"; @@ -20,6 +17,7 @@ import { Project } from "../../shared/models/project"; import { ProjectService } from "../../shared/services/project.service"; import { MockedProjectService } from "../../shared/services/project.service.spec"; import { SettingsService } from "../../shared/services/settings.service"; +import { MockedToasterService } from "../../shared/services/toaster.service.spec"; describe('ProjectMapShortcutsComponent', () => { diff --git a/src/app/settings/settings.component.spec.ts b/src/app/settings/settings.component.spec.ts index feaf3b22..a68e5e41 100644 --- a/src/app/settings/settings.component.spec.ts +++ b/src/app/settings/settings.component.spec.ts @@ -1,12 +1,15 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SettingsComponent } from './settings.component'; import { MatCheckboxModule, MatExpansionModule } from "@angular/material"; import { FormsModule } from "@angular/forms"; -import { SettingsService } from "../shared/services/settings.service"; -import { PersistenceModule } from "angular-persistence"; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; -import { MockedToasterService, ToasterService } from "../shared/services/toaster.service"; + +import { PersistenceModule } from "angular-persistence"; + +import { SettingsComponent } from './settings.component'; +import { SettingsService } from "../shared/services/settings.service"; +import { ToasterService } from "../shared/services/toaster.service"; +import { MockedToasterService } from "../shared/services/toaster.service.spec"; + describe('SettingsComponent', () => { let component: SettingsComponent; diff --git a/src/app/shared/services/toaster.service.spec.ts b/src/app/shared/services/toaster.service.spec.ts index 8749e67b..a5bdafd4 100644 --- a/src/app/shared/services/toaster.service.spec.ts +++ b/src/app/shared/services/toaster.service.spec.ts @@ -1,7 +1,27 @@ import { TestBed, inject } from '@angular/core/testing'; +import { MatSnackBar } from '@angular/material'; import { ToasterService } from './toaster.service'; -import { MatSnackBar } from '@angular/material'; + + +export class MockedToasterService { + public errors: string[]; + public successes: string[]; + + constructor() { + this.errors = []; + this.successes = []; + } + + public error(message: string) { + this.errors.push(message); + } + + public success(message: string) { + this.successes.push(message); + } +} + class MockedSnackBar { public open(message: string, ignored: any, options: any) {} diff --git a/src/app/shared/services/toaster.service.ts b/src/app/shared/services/toaster.service.ts index 472337a9..d85e7b08 100644 --- a/src/app/shared/services/toaster.service.ts +++ b/src/app/shared/services/toaster.service.ts @@ -14,22 +14,3 @@ export class ToasterService { } } - -@Injectable() -export class MockedToasterService { - public errors: string[]; - public successes: string[]; - - constructor() { - this.errors = []; - this.successes = []; - } - - public error(message: string) { - this.errors.push(message); - } - - public success(message: string) { - this.successes.push(message); - } -}