From 76887a06e56dc6989abcb6cfad37e1215bf3772a Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Fri, 10 Sep 2021 15:18:23 +0200 Subject: [PATCH] Fixed some tests --- .../pages/accessibility/accessibility.component.spec.ts | 7 ++++--- .../src/app/pages/start/start.component.spec.ts | 3 ++- .../layout/components/footer/footer.component.spec.ts | 4 ++-- apps/mina-sidor-fa/src/app/shared/utils/sort.util.ts | 1 - 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/mina-sidor-fa/src/app/pages/accessibility/accessibility.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/accessibility/accessibility.component.spec.ts index f2cb162..ff0abeb 100644 --- a/apps/mina-sidor-fa/src/app/pages/accessibility/accessibility.component.spec.ts +++ b/apps/mina-sidor-fa/src/app/pages/accessibility/accessibility.component.spec.ts @@ -1,4 +1,5 @@ -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AccessibilityComponent } from './accessibility.component'; @@ -10,9 +11,9 @@ describe('AccessibilityComponent', () => { beforeEach( waitForAsync(() => { void TestBed.configureTestingModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], declarations: [AccessibilityComponent], - imports: [RouterTestingModule], + imports: [RouterTestingModule, HttpClientTestingModule], }).compileComponents(); }) ); diff --git a/apps/mina-sidor-fa/src/app/pages/start/start.component.spec.ts b/apps/mina-sidor-fa/src/app/pages/start/start.component.spec.ts index 1cc5f31..8bc592e 100644 --- a/apps/mina-sidor-fa/src/app/pages/start/start.component.spec.ts +++ b/apps/mina-sidor-fa/src/app/pages/start/start.component.spec.ts @@ -1,3 +1,4 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; @@ -12,7 +13,7 @@ describe('StartComponent', () => { void TestBed.configureTestingModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: [StartComponent], - imports: [RouterTestingModule], + imports: [RouterTestingModule, HttpClientTestingModule], }).compileComponents(); }) ); diff --git a/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.spec.ts b/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.spec.ts index 5082b5f..c1bde69 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.spec.ts +++ b/apps/mina-sidor-fa/src/app/shared/components/layout/components/footer/footer.component.spec.ts @@ -1,4 +1,4 @@ -import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { FooterComponent } from './footer.component'; @@ -10,7 +10,7 @@ describe('FooterComponent', () => { beforeEach( waitForAsync(() => { void TestBed.configureTestingModule({ - schemas: [CUSTOM_ELEMENTS_SCHEMA], + schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], declarations: [FooterComponent], imports: [RouterTestingModule], }).compileComponents(); diff --git a/apps/mina-sidor-fa/src/app/shared/utils/sort.util.ts b/apps/mina-sidor-fa/src/app/shared/utils/sort.util.ts index 6474167..b4a067e 100644 --- a/apps/mina-sidor-fa/src/app/shared/utils/sort.util.ts +++ b/apps/mina-sidor-fa/src/app/shared/utils/sort.util.ts @@ -22,7 +22,6 @@ export function sortFromToDates(a: FromToDates, b: FromToDates): number { }; if (!a.from || !b.from) { - console.error('Some date is not set: ', { a, b }); return -1; }