From a5d02fef8ddca08ea946d1e4d2ea77109bce7d51 Mon Sep 17 00:00:00 2001 From: andrew setterfield Date: Mon, 29 Apr 2024 14:14:18 +0100 Subject: [PATCH] update unit tests to remove deprecated methods --- .../pages/communication/__tests__/communication.page.spec.ts | 5 ++--- .../confirm-submit-modal/__tests__/submit-modal.spec.ts | 4 ++-- src/app/pages/dashboard/__tests__/dashboard.page.spec.ts | 5 ++--- .../go-to-journal-card/__tests__/go-to-journal-card.spec.ts | 5 ++--- .../__tests__/health-declaration-modal.spec.ts | 4 ++-- src/app/pages/journal/__tests__/journal.page.spec.ts | 5 ++--- src/app/pages/login/__tests__/login.page.spec.ts | 5 ++--- .../__tests__/pass-finalisation.cat-a-mod1.page.spec.ts | 5 ++--- .../__tests__/pass-finalisation.cat-a-mod2.page.spec.ts | 5 ++--- .../__tests__/pass-finalisation.cat-adi-part2.page.spec.ts | 5 ++--- .../__tests__/pass-finalisation.cat-adi-part3.page.spec.ts | 5 ++--- .../cat-b/__tests__/pass-finalisation.cat-b.page.spec.ts | 5 ++--- .../cat-c/__tests__/pass-finalisation.cat-c.page.spec.ts | 5 ++--- .../cat-cpc/__tests__/pass-finalisation.cat-cpc.page.spec.ts | 5 ++--- .../cat-d/__tests__/pass-finalisation.cat-d.page.spec.ts | 5 ++--- .../__tests__/pass-finalisation.cat-home-test.page.spec.ts | 5 ++--- .../__tests__/pass-finalisation.cat-manoeuvre.page.spec.ts | 5 ++--- .../__tests__/post-debrief-holding.page.spec.ts | 5 ++--- .../__tests__/test-centre-journal.page.spec.ts | 5 ++--- .../pages/waiting-room/__tests__/waiting-room.page.spec.ts | 5 ++--- .../__tests__/practice-mode-banner.spec.ts | 5 ++--- 21 files changed, 42 insertions(+), 61 deletions(-) diff --git a/src/app/pages/communication/__tests__/communication.page.spec.ts b/src/app/pages/communication/__tests__/communication.page.spec.ts index 8a0343a8b..e539dc9e1 100644 --- a/src/app/pages/communication/__tests__/communication.page.spec.ts +++ b/src/app/pages/communication/__tests__/communication.page.spec.ts @@ -24,8 +24,7 @@ import { EndTestLinkComponent } from '@components/common/end-test-link/end-test- import { LockScreenIndicator } from '@components/common/screen-lock-indicator/lock-screen-indicator'; import { CandidateSectionComponent } from '@components/common/candidate-section/candidate-section'; import { candidateMock } from '@store/tests/__mocks__/tests.mock'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CommunicationPage } from '@pages/communication/communication.page'; import { CommunicationSubmitInfo, CommunicationViewDidEnter } from '@pages/communication/communication.actions'; @@ -53,7 +52,7 @@ describe('CommunicationPage', () => { MockComponent(CandidateSectionComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, TranslateModule, ReactiveFormsModule, diff --git a/src/app/pages/confirm-test-details/components/confirm-submit-modal/__tests__/submit-modal.spec.ts b/src/app/pages/confirm-test-details/components/confirm-submit-modal/__tests__/submit-modal.spec.ts index d07ef7596..08ee1cec8 100644 --- a/src/app/pages/confirm-test-details/components/confirm-submit-modal/__tests__/submit-modal.spec.ts +++ b/src/app/pages/confirm-test-details/components/confirm-submit-modal/__tests__/submit-modal.spec.ts @@ -3,7 +3,6 @@ import { By } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { provideMockStore } from '@ngrx/store/testing'; -import { RouterTestingModule } from '@angular/router/testing'; import { ModalControllerMock } from '@mocks/ionic-mocks/modal-controller.mock'; import { ComponentsModule } from '@components/common/common-components.module'; import { IonicModule, ModalController, NavParams } from '@ionic/angular'; @@ -12,6 +11,7 @@ import { } from '@pages/journal/components/journal-early-start-modal/__mocks__/journal-early-start-modal.mock'; import { NavParamsMock } from '@pages/journal/components/journal-early-start-modal/__mocks__/nav-params.mock'; import { ConfirmSubmitModal } from '../confirm-submit-modal'; +import { RouterModule } from '@angular/router'; describe('ConfirmSubmitModal', () => { let modalFixture: ComponentFixture; @@ -25,7 +25,7 @@ describe('ConfirmSubmitModal', () => { ConfirmSubmitModal, ], imports: [ - RouterTestingModule, + RouterModule, CommonModule, FormsModule, IonicModule, diff --git a/src/app/pages/dashboard/__tests__/dashboard.page.spec.ts b/src/app/pages/dashboard/__tests__/dashboard.page.spec.ts index 880882b12..6b16c4008 100644 --- a/src/app/pages/dashboard/__tests__/dashboard.page.spec.ts +++ b/src/app/pages/dashboard/__tests__/dashboard.page.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { AlertController, IonicModule, ModalController, Platform } from '@ionic/angular'; import { AlertControllerMock, ModalControllerMock, PlatformMock, RouterMock } from '@mocks/index.mock'; -import { RouterTestingModule } from '@angular/router/testing'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { StoreModule } from '@ngrx/store'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of, Subscription } from 'rxjs'; @@ -78,7 +77,7 @@ describe('DashboardPage', () => { TestBed.configureTestingModule({ declarations: [DashboardPage], imports: [ - RouterTestingModule.withRoutes( + RouterModule.forRoot( [ { path: '', diff --git a/src/app/pages/dashboard/components/go-to-journal-card/__tests__/go-to-journal-card.spec.ts b/src/app/pages/dashboard/components/go-to-journal-card/__tests__/go-to-journal-card.spec.ts index b1d759465..b2c48c8de 100644 --- a/src/app/pages/dashboard/components/go-to-journal-card/__tests__/go-to-journal-card.spec.ts +++ b/src/app/pages/dashboard/components/go-to-journal-card/__tests__/go-to-journal-card.spec.ts @@ -1,5 +1,4 @@ -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { JOURNAL_PAGE } from '@pages/page-names.constants'; import { JournalPage } from '@pages/journal/journal.page'; @@ -17,7 +16,7 @@ describe('GoToJournalCard', () => { declarations: [GoToJournalCardComponent], imports: [ IonicModule, - RouterTestingModule.withRoutes( + RouterModule.forRoot( [ { path: 'journal', diff --git a/src/app/pages/health-declaration/components/health-declaration-modal/__tests__/health-declaration-modal.spec.ts b/src/app/pages/health-declaration/components/health-declaration-modal/__tests__/health-declaration-modal.spec.ts index 4bbf369c7..94edd3983 100644 --- a/src/app/pages/health-declaration/components/health-declaration-modal/__tests__/health-declaration-modal.spec.ts +++ b/src/app/pages/health-declaration/components/health-declaration-modal/__tests__/health-declaration-modal.spec.ts @@ -3,7 +3,6 @@ import { By } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { provideMockStore } from '@ngrx/store/testing'; -import { RouterTestingModule } from '@angular/router/testing'; import { ModalControllerMock } from '@mocks/ionic-mocks/modal-controller.mock'; import { ComponentsModule } from '@components/common/common-components.module'; import { IonicModule, ModalController, NavParams } from '@ionic/angular'; @@ -12,6 +11,7 @@ import { } from '@pages/journal/components/journal-early-start-modal/__mocks__/journal-early-start-modal.mock'; import { NavParamsMock } from '@pages/journal/components/journal-early-start-modal/__mocks__/nav-params.mock'; import { HealthDeclarationModal } from '../health-declaration-modal'; +import { RouterModule } from '@angular/router'; describe('healthDeclarationModal', () => { let modalFixture: ComponentFixture; @@ -25,7 +25,7 @@ describe('healthDeclarationModal', () => { HealthDeclarationModal, ], imports: [ - RouterTestingModule, + RouterModule, CommonModule, FormsModule, IonicModule, diff --git a/src/app/pages/journal/__tests__/journal.page.spec.ts b/src/app/pages/journal/__tests__/journal.page.spec.ts index b096edb21..ad8421d46 100644 --- a/src/app/pages/journal/__tests__/journal.page.spec.ts +++ b/src/app/pages/journal/__tests__/journal.page.spec.ts @@ -8,7 +8,6 @@ import { StoreModel } from '@shared/models/store.model'; import { Subscription } from 'rxjs'; import { DateTimeProvider } from '@providers/date-time/date-time'; import { DateTimeProviderMock } from '@providers/date-time/__mocks__/date-time.mock'; -import { RouterTestingModule } from '@angular/router/testing'; import { CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core'; import { JournalPage } from '@pages/journal/journal.page'; import { JournalComponentsModule } from '@pages/journal/components/journal-components.module'; @@ -46,7 +45,7 @@ import { AccessibilityService } from '@providers/accessibility/accessibility.ser import { AccessibilityServiceMock } from '@providers/accessibility/__mocks__/accessibility-service.mock'; import { LogHelper } from '@providers/logs/logs-helper'; import { LogHelperMock } from '@providers/logs/__mocks__/logs-helper.mock'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, RouterModule } from '@angular/router'; import { HttpStatusCode } from '@angular/common/http'; describe('JournalPage', () => { @@ -69,7 +68,7 @@ describe('JournalPage', () => { JournalPage, ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), JournalComponentsModule, TestSlotComponentsModule, StoreModule.forRoot({ diff --git a/src/app/pages/login/__tests__/login.page.spec.ts b/src/app/pages/login/__tests__/login.page.spec.ts index b2874344c..1c0507230 100644 --- a/src/app/pages/login/__tests__/login.page.spec.ts +++ b/src/app/pages/login/__tests__/login.page.spec.ts @@ -1,10 +1,9 @@ import { ComponentFixture, fakeAsync, flushMicrotasks, TestBed, waitForAsync } from '@angular/core/testing'; import { AlertController, IonicModule, LoadingController, MenuController, Platform } from '@ionic/angular'; -import { Navigation, NavigationExtras, Router } from '@angular/router'; +import { Navigation, NavigationExtras, Router, RouterModule } from '@angular/router'; import { StoreModule } from '@ngrx/store'; import { SplashScreen } from '@capacitor/splash-screen'; import { Capacitor } from '@capacitor/core'; -import { RouterTestingModule } from '@angular/router/testing'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { AppConfigProvider } from '@providers/app-config/app-config'; import { AppConfigProviderMock } from '@providers/app-config/__mocks__/app-config.mock'; @@ -52,7 +51,7 @@ describe('LoginPage', () => { TestBed.configureTestingModule({ declarations: [LoginPage], imports: [ - RouterTestingModule.withRoutes( + RouterModule.forRoot( [ { path: '', diff --git a/src/app/pages/pass-finalisation/cat-a-mod1/__tests__/pass-finalisation.cat-a-mod1.page.spec.ts b/src/app/pages/pass-finalisation/cat-a-mod1/__tests__/pass-finalisation.cat-a-mod1.page.spec.ts index 0b2c2359f..803790f69 100644 --- a/src/app/pages/pass-finalisation/cat-a-mod1/__tests__/pass-finalisation.cat-a-mod1.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-a-mod1/__tests__/pass-finalisation.cat-a-mod1.page.spec.ts @@ -20,8 +20,7 @@ import { NavController, Platform } from '@ionic/angular'; import { AppModule } from '@app/app.module'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { PersistTests } from '@store/tests/tests.actions'; import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; @@ -61,7 +60,7 @@ describe('PassFinalisationCatAMod1Page', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-a-mod2/__tests__/pass-finalisation.cat-a-mod2.page.spec.ts b/src/app/pages/pass-finalisation/cat-a-mod2/__tests__/pass-finalisation.cat-a-mod2.page.spec.ts index 66a3c623b..f3e6c00bd 100644 --- a/src/app/pages/pass-finalisation/cat-a-mod2/__tests__/pass-finalisation.cat-a-mod2.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-a-mod2/__tests__/pass-finalisation.cat-a-mod2.page.spec.ts @@ -20,10 +20,9 @@ import { WarningBannerComponent } from '@components/common/warning-banner/warnin import { LicenceProvidedWarningBannerComponent, } from '@pages/pass-finalisation/components/licence-provided-warning-banner/licence-provided-warning-banner'; -import { RouterTestingModule } from '@angular/router/testing'; import { AppModule } from '@app/app.module'; import { NavControllerMock, PlatformMock, RouterMock } from '@mocks/index.mock'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { AuthenticationProvider } from '@providers/authentication/authentication'; import { AuthenticationProviderMock } from '@providers/authentication/__mocks__/authentication.mock'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; @@ -66,7 +65,7 @@ describe('PassFinalisationCatAMod2Page', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-adi-part2/__tests__/pass-finalisation.cat-adi-part2.page.spec.ts b/src/app/pages/pass-finalisation/cat-adi-part2/__tests__/pass-finalisation.cat-adi-part2.page.spec.ts index 1bdb520af..e0e82b588 100644 --- a/src/app/pages/pass-finalisation/cat-adi-part2/__tests__/pass-finalisation.cat-adi-part2.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-adi-part2/__tests__/pass-finalisation.cat-adi-part2.page.spec.ts @@ -20,8 +20,7 @@ import { NavController, Platform } from '@ionic/angular'; import { AppModule } from '@app/app.module'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { PersistTests } from '@store/tests/tests.actions'; import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; @@ -55,7 +54,7 @@ describe('PassFinalisationCatADI2Page', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-adi-part3/__tests__/pass-finalisation.cat-adi-part3.page.spec.ts b/src/app/pages/pass-finalisation/cat-adi-part3/__tests__/pass-finalisation.cat-adi-part3.page.spec.ts index 7c9f2e9a3..372fbde94 100644 --- a/src/app/pages/pass-finalisation/cat-adi-part3/__tests__/pass-finalisation.cat-adi-part3.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-adi-part3/__tests__/pass-finalisation.cat-adi-part3.page.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { NavController, Platform } from '@ionic/angular'; import { NavControllerMock, PlatformMock, RouterMock } from '@mocks/index.mock'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { AuthenticationProvider } from '@providers/authentication/authentication'; import { AuthenticationProviderMock } from '@providers/authentication/__mocks__/authentication.mock'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; @@ -11,7 +11,6 @@ import { MockComponent } from 'ng-mocks'; import { PracticeModeBanner } from '@components/common/practice-mode-banner/practice-mode-banner'; import { DebriefWitnessedComponent } from '@components/test-finalisation/debrief-witnessed/debrief-witnessed'; import { FinalisationHeaderComponent } from '@components/test-finalisation/finalisation-header/finalisation-header'; -import { RouterTestingModule } from '@angular/router/testing'; import { AppModule } from '@app/app.module'; import { FurtherDevelopmentComponent, @@ -118,7 +117,7 @@ describe('PassFinalisationCatADIPart3Page', () => { MockComponent(FurtherDevelopmentComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-b/__tests__/pass-finalisation.cat-b.page.spec.ts b/src/app/pages/pass-finalisation/cat-b/__tests__/pass-finalisation.cat-b.page.spec.ts index e48c6109a..42196d023 100644 --- a/src/app/pages/pass-finalisation/cat-b/__tests__/pass-finalisation.cat-b.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-b/__tests__/pass-finalisation.cat-b.page.spec.ts @@ -28,8 +28,7 @@ import { } from '@pages/pass-finalisation/components/pass-certificate-number/pass-certificate-number.constants'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { ProvisionalLicenseNotReceived } from '@store/tests/pass-completion/pass-completion.actions'; import { TestCategory } from '@dvsa/mes-test-schema/category-definitions/common/test-category'; @@ -136,7 +135,7 @@ describe('PassFinalisationCatBPage', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-c/__tests__/pass-finalisation.cat-c.page.spec.ts b/src/app/pages/pass-finalisation/cat-c/__tests__/pass-finalisation.cat-c.page.spec.ts index 7e96fb68f..f7101a2ba 100644 --- a/src/app/pages/pass-finalisation/cat-c/__tests__/pass-finalisation.cat-c.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-c/__tests__/pass-finalisation.cat-c.page.spec.ts @@ -23,8 +23,7 @@ import { NavController, Platform } from '@ionic/angular'; import { AppModule } from '@app/app.module'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { TestCategory } from '@dvsa/mes-test-schema/category-definitions/common/test-category'; import { TransmissionType } from '@shared/models/transmission-type'; @@ -270,7 +269,7 @@ describe('PassFinalisationCatCPage', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-cpc/__tests__/pass-finalisation.cat-cpc.page.spec.ts b/src/app/pages/pass-finalisation/cat-cpc/__tests__/pass-finalisation.cat-cpc.page.spec.ts index 1c36c0ad7..4375d61bc 100644 --- a/src/app/pages/pass-finalisation/cat-cpc/__tests__/pass-finalisation.cat-cpc.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-cpc/__tests__/pass-finalisation.cat-cpc.page.spec.ts @@ -17,8 +17,7 @@ import { import { NavController, Platform } from '@ionic/angular'; import { AppModule } from '@app/app.module'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { PersistTests } from '@store/tests/tests.actions'; import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; @@ -46,7 +45,7 @@ describe('PassFinalisationCatCPCPage', () => { MockComponent(WarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-d/__tests__/pass-finalisation.cat-d.page.spec.ts b/src/app/pages/pass-finalisation/cat-d/__tests__/pass-finalisation.cat-d.page.spec.ts index e26762d6b..621d164a5 100644 --- a/src/app/pages/pass-finalisation/cat-d/__tests__/pass-finalisation.cat-d.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-d/__tests__/pass-finalisation.cat-d.page.spec.ts @@ -23,8 +23,7 @@ import { import { AppModule } from '@app/app.module'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { TestCategory } from '@dvsa/mes-test-schema/category-definitions/common/test-category'; import { TransmissionType } from '@shared/models/transmission-type'; @@ -267,7 +266,7 @@ describe('PassFinalisationCatDPage', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-home-test/__tests__/pass-finalisation.cat-home-test.page.spec.ts b/src/app/pages/pass-finalisation/cat-home-test/__tests__/pass-finalisation.cat-home-test.page.spec.ts index e28c21819..c1af27a3d 100644 --- a/src/app/pages/pass-finalisation/cat-home-test/__tests__/pass-finalisation.cat-home-test.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-home-test/__tests__/pass-finalisation.cat-home-test.page.spec.ts @@ -22,8 +22,7 @@ import { NavController, Platform } from '@ionic/angular'; import { AppModule } from '@app/app.module'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { PersistTests } from '@store/tests/tests.actions'; import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; @@ -57,7 +56,7 @@ describe('PassFinalisationCatHomeTestPage', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/pass-finalisation/cat-manoeuvre/__tests__/pass-finalisation.cat-manoeuvre.page.spec.ts b/src/app/pages/pass-finalisation/cat-manoeuvre/__tests__/pass-finalisation.cat-manoeuvre.page.spec.ts index 560b98a4c..1cf2a51ae 100644 --- a/src/app/pages/pass-finalisation/cat-manoeuvre/__tests__/pass-finalisation.cat-manoeuvre.page.spec.ts +++ b/src/app/pages/pass-finalisation/cat-manoeuvre/__tests__/pass-finalisation.cat-manoeuvre.page.spec.ts @@ -21,8 +21,7 @@ import { NavController, Platform } from '@ionic/angular'; import { AppModule } from '@app/app.module'; import { D255Component } from '@components/test-finalisation/d255/d255'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { OutcomeBehaviourMapProvider } from '@providers/outcome-behaviour-map/outcome-behaviour-map'; import { PersistTests } from '@store/tests/tests.actions'; import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; @@ -55,7 +54,7 @@ describe('PassFinalisationCatManoeuvrePage', () => { MockComponent(LicenceProvidedWarningBannerComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, ], providers: [ diff --git a/src/app/pages/post-debrief-holding/__tests__/post-debrief-holding.page.spec.ts b/src/app/pages/post-debrief-holding/__tests__/post-debrief-holding.page.spec.ts index b48d8059e..7a2f68add 100644 --- a/src/app/pages/post-debrief-holding/__tests__/post-debrief-holding.page.spec.ts +++ b/src/app/pages/post-debrief-holding/__tests__/post-debrief-holding.page.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { StoreModule } from '@ngrx/store'; -import { RouterTestingModule } from '@angular/router/testing'; import { AppModule } from '@app/app.module'; import { MockComponent } from 'ng-mocks'; import { PracticeModeBanner } from '@components/common/practice-mode-banner/practice-mode-banner'; @@ -24,7 +23,7 @@ describe('PostDebriefHoldingPage', () => { MockComponent(PracticeModeBanner), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, StoreModule.forFeature('tests', () => ({})), ], diff --git a/src/app/pages/test-centre-journal/__tests__/test-centre-journal.page.spec.ts b/src/app/pages/test-centre-journal/__tests__/test-centre-journal.page.spec.ts index d650c569b..ca77086cf 100644 --- a/src/app/pages/test-centre-journal/__tests__/test-centre-journal.page.spec.ts +++ b/src/app/pages/test-centre-journal/__tests__/test-centre-journal.page.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule, LoadingController } from '@ionic/angular'; import { CommonModule } from '@angular/common'; -import { RouterTestingModule } from '@angular/router/testing'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { StoreModule } from '@ngrx/store'; import { of, throwError } from 'rxjs'; @@ -33,7 +32,7 @@ import { TestCentreJournalPage } from '../test-centre-journal.page'; import { TestCentreJournalComponentsModule } from '../components/test-centre-journal-components.module'; import { DeviceProvider } from '@providers/device/device'; import { DeviceProviderMock } from '@providers/device/__mocks__/device.mock'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, RouterModule } from '@angular/router'; import { ActivatedRouteMock } from '@mocks/angular-mocks/activated-route.mock'; import { HttpStatusCode } from '@angular/common/http'; @@ -57,7 +56,7 @@ describe('TestCenterJournalPage', () => { CommonModule, ComponentsModule, TestCentreJournalComponentsModule, - RouterTestingModule.withRoutes( + RouterModule.forRoot( [ { path: '', diff --git a/src/app/pages/waiting-room/__tests__/waiting-room.page.spec.ts b/src/app/pages/waiting-room/__tests__/waiting-room.page.spec.ts index 7763a0035..db5ade42a 100644 --- a/src/app/pages/waiting-room/__tests__/waiting-room.page.spec.ts +++ b/src/app/pages/waiting-room/__tests__/waiting-room.page.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; import { ModalController, Platform } from '@ionic/angular'; import { PlatformMock, RouterMock } from '@mocks/index.mock'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { Store, StoreModule } from '@ngrx/store'; import { Observable, Subscription } from 'rxjs'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; @@ -9,7 +9,6 @@ import { ScreenOrientation } from '@capawesome/capacitor-screen-orientation'; import { MockComponent } from 'ng-mocks'; import { UntypedFormControl, Validators } from '@angular/forms'; import { JournalData, TestResultCommonSchema, TestSlotAttributes } from '@dvsa/mes-test-schema/categories/common'; -import { RouterTestingModule } from '@angular/router/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TestCategory } from '@dvsa/mes-test-schema/category-definitions/common/test-category'; import { KeepAwake as Insomnia } from '@capacitor-community/keep-awake'; @@ -150,7 +149,7 @@ describe('WaitingRoomPage', () => { MockComponent(CBTNumberComponent), ], imports: [ - RouterTestingModule.withRoutes([]), + RouterModule.forRoot([]), AppModule, TranslateModule, StoreModule.forFeature('tests', () => ({ diff --git a/src/components/common/practice-mode-banner/__tests__/practice-mode-banner.spec.ts b/src/components/common/practice-mode-banner/__tests__/practice-mode-banner.spec.ts index 8c0bfccfd..f7243a658 100644 --- a/src/components/common/practice-mode-banner/__tests__/practice-mode-banner.spec.ts +++ b/src/components/common/practice-mode-banner/__tests__/practice-mode-banner.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { Router, RouterModule } from '@angular/router'; import { StoreModule } from '@ngrx/store'; import { TestCategory } from '@dvsa/mes-test-schema/category-definitions/common/test-category'; @@ -17,7 +16,7 @@ describe('PracticeModeBanner', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [PracticeModeBanner], - imports: [IonicModule, RouterTestingModule, StoreModule.forRoot({ + imports: [IonicModule, RouterModule, StoreModule.forRoot({ tests: () => ({ currentTest: { testCategory: TestCategory.B }, testStatus: {},