From 77f5022fb5e65af6fce783e214b9a652f6db787e Mon Sep 17 00:00:00 2001 From: gpascal123 Date: Wed, 23 Jul 2025 08:35:35 +0200 Subject: [PATCH] Error when executing tests fixed. --- .../crackers/new-cracker/new-cracker.component.spec.ts | 4 +++- .../confirm-dialog/confirm-dialog.component.spec.ts | 9 ++++++++- src/app/users/new-user/new-user.component.spec.ts | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/config/engine/crackers/new-cracker/new-cracker.component.spec.ts b/src/app/config/engine/crackers/new-cracker/new-cracker.component.spec.ts index 12d010cc2..cc4d3432a 100644 --- a/src/app/config/engine/crackers/new-cracker/new-cracker.component.spec.ts +++ b/src/app/config/engine/crackers/new-cracker/new-cracker.component.spec.ts @@ -1,3 +1,4 @@ +import { provideHttpClient } from '@angular/common/http'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NewCrackerComponent } from '@src/app/config/engine/crackers/new-cracker/new-cracker.component'; @@ -8,7 +9,8 @@ describe('NewCrackerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NewCrackerComponent] + imports: [NewCrackerComponent], + providers: [provideHttpClient()] }).compileComponents(); fixture = TestBed.createComponent(NewCrackerComponent); diff --git a/src/app/core/_components/confirm-dialog/confirm-dialog.component.spec.ts b/src/app/core/_components/confirm-dialog/confirm-dialog.component.spec.ts index b5f8907c5..e0c1ecc19 100644 --- a/src/app/core/_components/confirm-dialog/confirm-dialog.component.spec.ts +++ b/src/app/core/_components/confirm-dialog/confirm-dialog.component.spec.ts @@ -1,4 +1,6 @@ +import { provideHttpClient } from '@angular/common/http'; import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ConfirmDialogComponent } from '@components/confirm-dialog/confirm-dialog.component'; @@ -8,7 +10,12 @@ describe('ConfirmDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ConfirmDialogComponent] + declarations: [ConfirmDialogComponent], + providers: [ + provideHttpClient(), + { provide: MatDialogRef, useValue: {} }, + { provide: MAT_DIALOG_DATA, useValue: {} } + ] }).compileComponents(); fixture = TestBed.createComponent(ConfirmDialogComponent); diff --git a/src/app/users/new-user/new-user.component.spec.ts b/src/app/users/new-user/new-user.component.spec.ts index a91979fc7..24097b4ed 100644 --- a/src/app/users/new-user/new-user.component.spec.ts +++ b/src/app/users/new-user/new-user.component.spec.ts @@ -1,3 +1,4 @@ +import { provideHttpClient } from '@angular/common/http'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NewUserComponent } from '@src/app/users/new-user/new-user.component'; @@ -8,7 +9,8 @@ describe('NewUserComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NewUserComponent] + declarations: [NewUserComponent], + providers: [provideHttpClient()] }).compileComponents(); fixture = TestBed.createComponent(NewUserComponent);