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

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

describe('permissions API', () => {
  it('loads permissions with the admin limit', async () => {
    vi.mocked(apiRequest).mockResolvedValueOnce({ rows: [] });

    await listPermissions();

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