import type { Logger } from '@core/shared/domain/Logger';
import { describe, expect, it, vi, type Mock } from 'vitest';
import { GetDashboardDataUseCase } from './GetDashboardDataUseCase';

describe('GetDashboardDataUseCase', () => {
  let logger: Logger;
  let useCase: GetDashboardDataUseCase;

  beforeEach(() => {
    logger = {
      debug: vi.fn(),
      info: vi.fn(),
      warn: vi.fn(),
      error: vi.fn(),
    } as unknown as Logger;

    useCase = new GetDashboardDataUseCase(logger);
  });

  it('returns placeholder dashboard metrics and logs retrieval', async () => {
    const result = await useCase.execute();

    expect(result.isOk()).toBe(true);
    const data = result.unwrap();
    expect(data).toEqual({
      totalUsers: 0,
      activeUsers: 0,
      totalRaces: 0,
      totalLeagues: 0,
    });

    expect((logger.info as unknown as Mock)).toHaveBeenCalled();
  });
});