test au vert

This commit is contained in:
styve Lioumba
2025-10-23 21:04:25 +02:00
parent 02637235e3
commit 4c1787d784
13 changed files with 482 additions and 855 deletions

View File

@@ -2,15 +2,32 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ProfileDetailComponent } from './profile-detail.component';
import { provideRouter } from '@angular/router';
import { AuthService } from '@app/core/services/authentication/auth.service';
import { ToastrService } from 'ngx-toastr';
import { PROJECT_REPOSITORY_TOKEN } from '@app/infrastructure/projects/project-repository.token';
import { ProjectRepository } from '@app/domain/projects/project.repository';
import { of } from 'rxjs';
import { Project } from '@app/domain/projects/project.model';
describe('ProfileDetailComponent', () => {
let component: ProfileDetailComponent;
let fixture: ComponentFixture<ProfileDetailComponent>;
let mockProjectRepository: jest.Mocked<ProjectRepository>;
beforeEach(async () => {
mockProjectRepository = {
create: jest.fn().mockReturnValue(of({} as Project)),
list: jest.fn().mockReturnValue(of([])),
get: jest.fn().mockReturnValue(of({} as Project)),
update: jest.fn().mockReturnValue(of({} as Project)),
};
await TestBed.configureTestingModule({
imports: [ProfileDetailComponent],
providers: [provideRouter([])],
providers: [
provideRouter([]),
{ provide: PROJECT_REPOSITORY_TOKEN, useValue: mockProjectRepository },
],
}).compileComponents();
fixture = TestBed.createComponent(ProfileDetailComponent);