import { SectorPresenter } from '@app/adapters/sectors/sector.presenter';
import { Sector } from '@app/domain/sectors/sector.model';
import { fakeSectors } from '@app/testing/sector.mock';

describe('SectorPresenter', () => {
  let presenter: SectorPresenter;

  beforeEach(() => {
    presenter = new SectorPresenter();
  });

  it('devrait transformer un Sector en SectorPresenterModel', () => {
    const sector: Sector = fakeSectors[0];

    const viewModel = presenter.toViewModel(sector);

    expect(viewModel).toEqual({
      id: sector.id,
      nom: sector.nom,
      noms: ['Informatique'],
    });
  });

  it('devrait transformer un tableau complet', () => {
    const result = presenter.toViewModels(fakeSectors);

    expect(result.length).toBe(5);
    expect(result[0].nom).toBe(fakeSectors[0].nom);
  });
});
