From 0c7301854cd806e3f08bff16ee07e2e790b258ed Mon Sep 17 00:00:00 2001 From: Thomas Schaffter Date: Wed, 1 Nov 2023 21:08:39 +0000 Subject: [PATCH] Fix tests for the About and Not Found pages --- libs/openchallenges/about/src/lib/about.component.spec.ts | 3 ++- .../not-found/src/lib/not-found.component.spec.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/openchallenges/about/src/lib/about.component.spec.ts b/libs/openchallenges/about/src/lib/about.component.spec.ts index d146da3700..59e6074e29 100644 --- a/libs/openchallenges/about/src/lib/about.component.spec.ts +++ b/libs/openchallenges/about/src/lib/about.component.spec.ts @@ -1,6 +1,7 @@ import { HttpClientModule } from '@angular/common/http'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; import { ConfigService } from '@sagebionetworks/openchallenges/config'; import { FooterComponent } from '@sagebionetworks/openchallenges/ui'; import { AboutComponent } from './about.component'; @@ -11,7 +12,7 @@ describe('AboutComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [HttpClientModule, FooterComponent], + imports: [HttpClientModule, RouterTestingModule, FooterComponent], providers: [ConfigService], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); diff --git a/libs/openchallenges/not-found/src/lib/not-found.component.spec.ts b/libs/openchallenges/not-found/src/lib/not-found.component.spec.ts index 3f22df9608..cb13bf1e89 100644 --- a/libs/openchallenges/not-found/src/lib/not-found.component.spec.ts +++ b/libs/openchallenges/not-found/src/lib/not-found.component.spec.ts @@ -1,6 +1,7 @@ import { HttpClientModule } from '@angular/common/http'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; import { ConfigService } from '@sagebionetworks/openchallenges/config'; import { NotFoundComponent } from './not-found.component'; @@ -11,7 +12,7 @@ describe('NotFoundComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [HttpClientModule, NotFoundComponent], + imports: [HttpClientModule, RouterTestingModule, NotFoundComponent], providers: [ConfigService], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents();