sector => clean archi et test vert

This commit is contained in:
styve Lioumba
2025-10-24 19:25:23 +02:00
parent 3654709250
commit b6241ff911
38 changed files with 453 additions and 313 deletions

View File

@@ -8,6 +8,9 @@ import { PROFILE_REPOSITORY_TOKEN } from '@app/infrastructure/profiles/profile-r
import { ProfileRepository } from '@app/domain/profiles/profile.repository';
import { of } from 'rxjs';
import { Profile } from '@app/domain/profiles/profile.model';
import { SectorRepository } from '@app/domain/sectors/sector.repository';
import { Sector } from '@app/domain/sectors/sector.model';
import { SECTOR_REPOSITORY_TOKEN } from '@app/infrastructure/sectors/sector-repository.token';
describe('MyProfileUpdateFormComponent', () => {
let component: MyProfileUpdateFormComponent;
@@ -15,6 +18,7 @@ describe('MyProfileUpdateFormComponent', () => {
let mockToastrService: Partial<ToastrService>;
let mockProfileRepo: ProfileRepository;
let mockSectorRepo: SectorRepository;
const mockProfileData = {
profession: '',
@@ -38,6 +42,11 @@ describe('MyProfileUpdateFormComponent', () => {
getByUserId: jest.fn().mockReturnValue(of({} as Profile)),
};
mockSectorRepo = {
list: jest.fn().mockReturnValue(of([])),
getOne: jest.fn().mockReturnValue(of({} as Sector)),
};
await TestBed.configureTestingModule({
imports: [MyProfileUpdateFormComponent],
providers: [
@@ -45,6 +54,7 @@ describe('MyProfileUpdateFormComponent', () => {
provideRouter([]),
{ provide: ToastrService, useValue: mockToastrService },
{ provide: PROFILE_REPOSITORY_TOKEN, useValue: mockProfileRepo },
{ provide: SECTOR_REPOSITORY_TOKEN, useValue: mockSectorRepo },
],
}).compileComponents();