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

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

describe('roles API', () => {
  it('loads roles', async () => {
    vi.mocked(apiRequest).mockResolvedValueOnce({ rows: [] });

    await listRoles();

    expect(apiRequest).toHaveBeenCalledWith('/roles?limit=1000');
  });
});
