diff --git a/modules/ui/src/app/app.store.spec.ts b/modules/ui/src/app/app.store.spec.ts index db8412790..6f1a2dba3 100644 --- a/modules/ui/src/app/app.store.spec.ts +++ b/modules/ui/src/app/app.store.spec.ts @@ -34,14 +34,6 @@ import { fetchSystemStatus, setDevices } from './store/actions'; import { MOCK_PROGRESS_DATA_IN_PROGRESS } from './mocks/testrun.mock'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NotificationService } from './services/notification.service'; -import { WINDOW } from './providers/window.provider'; -import { Routes } from './model/routes'; - -const windowMock = { - location: { - href: '', - }, -}; const mock = (() => { let store: { [key: string]: string } = {}; @@ -84,7 +76,6 @@ describe('AppStore', () => { }), { provide: TestRunService, useValue: mockService }, { provide: NotificationService, useValue: mockNotificationService }, - { provide: WINDOW, useValue: windowMock }, ], imports: [BrowserAnimationsModule], }); @@ -201,28 +192,6 @@ describe('AppStore', () => { ); store.refreshState(); }); - - it('should notify when url is not "/testing"', () => { - windowMock.location.href = 'localhost:8080'; - store.overrideSelector( - selectStatus, - MOCK_PROGRESS_DATA_IN_PROGRESS.status - ); - store.refreshState(); - - expect(mockNotificationService.notify).toHaveBeenCalled(); - }); - - it('should not notify when url is "/testing"', () => { - windowMock.location.href = 'localhost:8080/' + Routes.Testing; - store.overrideSelector( - selectStatus, - MOCK_PROGRESS_DATA_IN_PROGRESS.status - ); - store.refreshState(); - - expect(mockNotificationService.notify).toHaveBeenCalledTimes(0); - }); }); }); }); diff --git a/modules/ui/src/app/app.store.ts b/modules/ui/src/app/app.store.ts index 5c0600033..66d4086b3 100644 --- a/modules/ui/src/app/app.store.ts +++ b/modules/ui/src/app/app.store.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Inject, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { ComponentStore } from '@ngrx/component-store'; import { tap } from 'rxjs/operators'; import { @@ -37,9 +37,6 @@ import { } from './store/actions'; import { TestrunStatus } from './model/testrun-status'; import { SettingMissedError, SystemInterfaces } from './model/setting'; -import { NotificationService } from './services/notification.service'; -import { Routes } from './model/routes'; -import { WINDOW } from './providers/window.provider'; export const CONSENT_SHOWN_KEY = 'CONSENT_SHOWN'; export interface AppComponentState { @@ -107,11 +104,8 @@ export class AppStore extends ComponentStore { statusLoaded = this.effect(() => { return this.systemStatus$.pipe( skip(1), - tap(status => { + tap(() => { this.updateIsStatusLoaded(true); - if (!this.window.location.href.includes(Routes.Testing)) { - this.notification.notify(`Test run is ${status}`); - } }) ); }); @@ -136,9 +130,7 @@ export class AppStore extends ComponentStore { constructor( private store: Store, - private testRunService: TestRunService, - private notification: NotificationService, - @Inject(WINDOW) private window: Window + private testRunService: TestRunService ) { super({ consentShown: sessionStorage.getItem(CONSENT_SHOWN_KEY) !== null,