import { describe, it, expect } from 'vitest';

describe('apiClient', () => {
  it('should export an apiClient object', async () => {
    process.env.NEXT_PUBLIC_API_BASE_URL = 'http://example.test';
    const { apiClient } = await import('./apiClient');
    expect(apiClient).toBeDefined();
    expect(typeof apiClient).toBe('object');
  });

  it('should have all expected domain clients', async () => {
    process.env.NEXT_PUBLIC_API_BASE_URL = 'http://example.test';
    const { apiClient } = await import('./apiClient');
    
    const expectedClients = [
      'leagues',
      'races',
      'drivers',
      'teams',
      'sponsors',
      'media',
      'analytics',
      'auth',
      'payments',
      'dashboard',
      'penalties',
      'protests',
      'admin',
    ];

    expectedClients.forEach(clientName => {
      expect(apiClient[clientName]).toBeDefined();
    });
  });
});
