correctif des tests et du workflow ci

This commit is contained in:
styve Lioumba
2025-10-05 15:06:14 +02:00
parent 6dc072b7eb
commit 9678ccbfc6
23 changed files with 207 additions and 25 deletions

View File

@@ -11,10 +11,12 @@ describe('MyHomeProfileComponent', () => {
imports: [MyHomeProfileComponent]
})
.compileComponents();
fixture = TestBed.createComponent(MyHomeProfileComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {

View File

@@ -11,10 +11,12 @@ describe('MyProfileProjectItemComponent', () => {
imports: [MyProfileProjectItemComponent]
})
.compileComponents();
fixture = TestBed.createComponent(MyProfileProjectItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {

View File

@@ -11,10 +11,12 @@ describe('ProjectListComponent', () => {
imports: [ProjectListComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ProjectListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {

View File

@@ -1,20 +1,29 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { VerticalProfileListComponent } from './vertical-profile-list.component';
import {Router} from "@angular/router";
describe('VerticalProfileListComponent', () => {
let component: VerticalProfileListComponent;
let fixture: ComponentFixture<VerticalProfileListComponent>;
const routerSpy = {
navigate: jest.fn(),
navigateByUrl: jest.fn(),
};
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [VerticalProfileListComponent]
imports: [VerticalProfileListComponent],
providers: [{ provide: Router, useValue: routerSpy }],
})
.compileComponents();
fixture = TestBed.createComponent(VerticalProfileListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {

View File

@@ -4,7 +4,7 @@ import {LoginComponent} from './login.component';
import {AuthService} from "@app/core/services/authentication/auth.service";
import {ToastrService} from "ngx-toastr";
import {FormBuilder} from "@angular/forms";
import {provideRouter} from "@angular/router";
import {provideRouter, Router} from "@angular/router";
describe('LoginComponent', () => {
let component: LoginComponent;
@@ -40,6 +40,8 @@ describe('LoginComponent', () => {
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
afterEach(() => {

View File

@@ -24,6 +24,8 @@ describe('PdfViewerComponent', () => {
component.profile = mockProfile;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {

View File

@@ -44,6 +44,8 @@ describe('RegisterComponent', () => {
fixture = TestBed.createComponent(RegisterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {

View File

@@ -11,10 +11,12 @@ describe('SearchComponent', () => {
imports: [SearchComponent]
})
.compileComponents();
fixture = TestBed.createComponent(SearchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
await fixture.whenStable();
});
it('should create', () => {