project et profile => clean archi et test vert

This commit is contained in:
styve Lioumba
2025-10-24 16:18:27 +02:00
parent 4c1787d784
commit 3654709250
48 changed files with 762 additions and 656 deletions

View File

@@ -2,15 +2,30 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MyProfileComponent } from './my-profile.component';
import { provideRouter } from '@angular/router';
import { ProfileRepository } from '@app/domain/profiles/profile.repository';
import { PROFILE_REPOSITORY_TOKEN } from '@app/infrastructure/profiles/profile-repository.token';
import { of } from 'rxjs';
import { Profile } from '@app/domain/profiles/profile.model';
describe('MyProfileComponent', () => {
let component: MyProfileComponent;
let fixture: ComponentFixture<MyProfileComponent>;
let mockProfileRepo: ProfileRepository;
beforeEach(async () => {
mockProfileRepo = {
create: jest.fn(),
list: jest.fn(),
update: jest.fn(),
getByUserId: jest.fn().mockReturnValue(of({} as Profile)),
};
await TestBed.configureTestingModule({
imports: [MyProfileComponent],
providers: [provideRouter([])],
providers: [
provideRouter([]),
{ provide: PROFILE_REPOSITORY_TOKEN, useValue: mockProfileRepo },
],
}).compileComponents();
fixture = TestBed.createComponent(MyProfileComponent);