import { describe, it, expect } from 'vitest';
import { ProtestDriverViewModel } from './ProtestDriverViewModel';
import type { DriverSummaryDTO } from '../types/generated/LeagueAdminProtestsDTO';

const createDriverSummary = (overrides: Partial<DriverSummaryDTO> = {}): DriverSummaryDTO => ({
  id: 'driver-1',
  name: 'Test Driver',
  ...overrides,
});

describe('ProtestDriverViewModel', () => {
  it('maps id and name from DriverSummaryDTO', () => {
    const dto = createDriverSummary({
      id: 'driver-123',
      name: 'Jane Doe',
    });

    const viewModel = new ProtestDriverViewModel(dto);

    expect(viewModel.id).toBe('driver-123');
    expect(viewModel.name).toBe('Jane Doe');
  });

  it('exposes underlying DTO fields as-is', () => {
    const dto = createDriverSummary();

    const viewModel = new ProtestDriverViewModel(dto);

    expect(viewModel.id).toBe(dto.id);
    expect(viewModel.name).toBe(dto.name);
  });
});
