refacto page mon profile

This commit is contained in:
styve Lioumba
2025-11-15 17:30:09 +01:00
parent 620b781219
commit b669190bce
29 changed files with 1702 additions and 743 deletions

View File

@@ -6,12 +6,14 @@ 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';
import {ToastrService} from "ngx-toastr";
describe('MyProfileComponent', () => {
let component: MyProfileComponent;
let fixture: ComponentFixture<MyProfileComponent>;
let mockProfileRepo: ProfileRepository;
let mockToastrService: Partial<ToastrService>;
beforeEach(async () => {
mockProfileRepo = {
@@ -20,11 +22,18 @@ describe('MyProfileComponent', () => {
update: jest.fn(),
getByUserId: jest.fn().mockReturnValue(of({} as Profile)),
};
mockToastrService = {
warning: jest.fn(),
success: jest.fn(),
info: jest.fn(),
error: jest.fn(),
};
await TestBed.configureTestingModule({
imports: [MyProfileComponent],
providers: [
provideRouter([]),
{ provide: PROFILE_REPOSITORY_TOKEN, useValue: mockProfileRepo },
{ provide: ToastrService, useValue: mockToastrService },
],
}).compileComponents();