import { FakeAuthRepository } from '@app/testing/domain/authentification/fake-auth.repository';
import { RegisterUseCase } from '@app/application/authentification/register.usecase';
import { RegisterDto } from '@app/domain/authentification/dto/register-dto';
import { firstValueFrom } from 'rxjs';

describe('RegisterUsecase', () => {
  it("devrait s'enregister", async () => {
    const repo = new FakeAuthRepository();
    const useCase = new RegisterUseCase(repo);

    const registerDto: RegisterDto = {
      email: 'bar@foo.com',
      emailVisibility: false,
      password: 'password1234',
      passwordConfirm: 'password1234',
    };
    const response = await firstValueFrom(useCase.execute(registerDto));

    expect(response.email).toEqual('bar@foo.com');
  });
});
