import { FakeProfileRepository } from '@app/testing/domain/profiles/fake-profile.repository';
import { mockProfiles } from '@app/testing/profile.mock';
import { UpdateProfileUseCase } from '@app/application/profiles/update-profile.usecase';

describe('UpdateProfileUseCase', () => {
  it('doit retourner un profile modifier', () => {
    const repo = new FakeProfileRepository();
    const useCase = new UpdateProfileUseCase(repo);
    const profile = mockProfiles[0];

    expect(profile.profession).toBe('Développeur Web');

    const profileUpdate = {
      ...profile,
      profession: 'Développeur fullstack',
    };
    useCase.execute('1', profileUpdate).subscribe({
      next: (profile) => {
        expect(profile.profession).toEqual('Développeur fullstack');
      },
    });
  });
});
