import type { GetLeagueOwnerSummaryResult } from '@core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase';
import { LeagueOwnerSummaryPresenter } from './LeagueOwnerSummaryPresenter';

describe('LeagueOwnerSummaryPresenter', () => {
  it('presents owner summary correctly', () => {
    const presenter = new LeagueOwnerSummaryPresenter();
    const output: GetLeagueOwnerSummaryResult = {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      league: {} as never,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      owner: {
        id: 'driver-1',
        iracingId: '12345',
        name: 'John Doe',
        country: 'US',
        bio: 'Racing enthusiast',
        joinedAt: { toDate: () => new Date('2024-01-01T00:00:00Z') } as never,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      } as never,
      totalMembers: 50,
      activeMembers: 45,
      rating: 1500,
      rank: 100,
    };

    presenter.present(output);
    const vm = presenter.getViewModel()!;

    expect(vm).not.toBeNull();
    expect(vm.driver.id).toBe('driver-1');
    expect(vm.rating).toBe(1500);
    expect(vm.rank).toBe(100);
  });
});