From adca81444eb745e1335e798587ee9b8980aff09e Mon Sep 17 00:00:00 2001 From: Bastian Wagner Date: Mon, 20 Jan 2025 13:36:51 +0100 Subject: [PATCH] Tests --- .../keys/components/lost-key/lost-key.component.spec.ts | 7 ++++++- .../components/lost-keys/lost-keys.component.spec.ts | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/client/src/app/modules/keys/components/lost-key/lost-key.component.spec.ts b/client/src/app/modules/keys/components/lost-key/lost-key.component.spec.ts index c241bd2..4ccb551 100644 --- a/client/src/app/modules/keys/components/lost-key/lost-key.component.spec.ts +++ b/client/src/app/modules/keys/components/lost-key/lost-key.component.spec.ts @@ -1,6 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { LostKeyComponent } from './lost-key.component'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; describe('LostKeyComponent', () => { let component: LostKeyComponent; @@ -8,7 +9,11 @@ describe('LostKeyComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [LostKeyComponent] + imports: [LostKeyComponent], + providers: [ + { provide: MatDialogRef, useValue: [] }, + { provide: MAT_DIALOG_DATA, useValue: [] } + ] }) .compileComponents(); diff --git a/client/src/app/modules/keys/components/lost-keys/lost-keys.component.spec.ts b/client/src/app/modules/keys/components/lost-keys/lost-keys.component.spec.ts index 6cee472..ee93253 100644 --- a/client/src/app/modules/keys/components/lost-keys/lost-keys.component.spec.ts +++ b/client/src/app/modules/keys/components/lost-keys/lost-keys.component.spec.ts @@ -1,6 +1,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { LostKeysComponent } from './lost-keys.component'; +import { ApiService } from '../../../../shared/api.service'; +import { MockApiService } from '../../../../../../mocks/services/mock.api.service'; +import { HotToastService } from '@ngxpert/hot-toast'; describe('LostKeysComponent', () => { let component: LostKeysComponent; @@ -8,7 +11,11 @@ describe('LostKeysComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [LostKeysComponent] + imports: [LostKeysComponent], + providers: [ + { provide: ApiService, useClass: MockApiService }, + HotToastService + ] }) .compileComponents();