import { describe, expect, it, vi } from 'vitest';
import { getClass } from '@/shared/api/classes';
import { apiRequest } from '@/shared/api/httpClient';

vi.mock('@/shared/api/httpClient', () => ({
  apiRequest: vi.fn(),
}));

describe('classes API', () => {
  it('gets a class by id', async () => {
    vi.mocked(apiRequest).mockResolvedValueOnce({ id: 'class-1', name: 'Room A' });

    await getClass('class-1');

    expect(apiRequest).toHaveBeenCalledWith('/classes/class-1');
  });
});
