diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 6b94a4e3e..9034a3836 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,25 +1,25 @@ -import { NgxWhatsNewModule } from 'ngx-whats-new'; import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; -import { TranslatePipe, TranslateService } from '@ngx-translate/core'; -import { ElectronServiceStub } from './services/electron.service.stub'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; -import { MockModule, MockPipe, MockProviders } from 'ng-mocks'; -import { of } from 'rxjs'; -import { WhatsNewService } from './services/whats-new.service'; -import { Theme } from './settings/theme.enum'; -import { SettingsService } from './services/settings.service'; import { Router } from '@angular/router'; -import { ChannelStore } from './state'; -import { STORE_KEY } from './shared/enums/store-keys.enum'; -import { WhatsNewServiceStub } from './services/whats-new.service.stub'; +import { RouterTestingModule } from '@angular/router/testing'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { MockModule, MockPipe, MockProviders } from 'ng-mocks'; +import { NgxWhatsNewModule } from 'ngx-whats-new'; +import { of } from 'rxjs'; +import { AppComponent } from './app.component'; import { DataService } from './services/data.service'; +import { ElectronServiceStub } from './services/electron.service.stub'; +import { SettingsService } from './services/settings.service'; +import { WhatsNewService } from './services/whats-new.service'; +import { WhatsNewServiceStub } from './services/whats-new.service.stub'; +import { Theme } from './settings/theme.enum'; +import { STORE_KEY } from './shared/enums/store-keys.enum'; +import { ChannelStore } from './state'; class MatSnackBarStub { open(): void {} @@ -113,10 +113,7 @@ describe('AppComponent', () => { jest.spyOn(router, 'navigateByUrl'); component.navigateToRoute(route); expect(router.navigateByUrl).toHaveBeenCalledTimes(1); - expect(router.navigateByUrl).toHaveBeenCalledWith( - route, - expect.anything() - ); + expect(router.navigateByUrl).toHaveBeenCalledWith(route); } )); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 66ad008c9..3d89e0b2f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -201,7 +201,7 @@ export class AppComponent { * @param route route to navigate to */ navigateToRoute(route: string) { - this.router.navigateByUrl(route, { skipLocationChange: true }); + this.router.navigateByUrl(route); } /** diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index ce095eaf1..12efb8a8f 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -1,21 +1,21 @@ -import { TranslateService } from '@ngx-translate/core'; -import { Component, OnInit } from '@angular/core'; -import { FormGroup, FormBuilder } from '@angular/forms'; -import { StorageMap } from '@ngx-pwa/local-storage'; -import { Router } from '@angular/router'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { Observable } from 'rxjs'; -import { STORE_KEY } from '../shared/enums/store-keys.enum'; -import { Settings, VideoPlayer } from './settings.interface'; import { HttpClient } from '@angular/common/http'; -import * as semver from 'semver'; -import { ChannelQuery } from '../state'; -import { EPG_FETCH } from '../../../shared/ipc-commands'; -import { Language } from './language.enum'; -import { Theme } from './theme.enum'; -import { SettingsService } from './../services/settings.service'; +import { Component, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup } from '@angular/forms'; +import { MatSnackBar } from '@angular/material/snack-bar'; +import { Router } from '@angular/router'; +import { StorageMap } from '@ngx-pwa/local-storage'; +import { TranslateService } from '@ngx-translate/core'; +import { Observable } from 'rxjs'; import { catchError } from 'rxjs/operators'; +import * as semver from 'semver'; +import { EPG_FETCH } from '../../../shared/ipc-commands'; import { DataService } from '../services/data.service'; +import { STORE_KEY } from '../shared/enums/store-keys.enum'; +import { ChannelQuery } from '../state'; +import { SettingsService } from './../services/settings.service'; +import { Language } from './language.enum'; +import { Settings, VideoPlayer } from './settings.interface'; +import { Theme } from './theme.enum'; /** Url of the package.json file in the app repository, required to get the version of the released app */ const PACKAGE_JSON_URL = @@ -205,7 +205,7 @@ export class SettingsComponent implements OnInit { * Navigates back to the applications homepage */ backToHome(): void { - this.router.navigateByUrl('/', { skipLocationChange: true }); + this.router.navigateByUrl('/'); } /**