import { beforeEach, describe, expect, it, vi } from 'vitest';
import { listPublicCampuses } from '@/shared/api/campuses';
import { apiRequest } from '@/shared/api/httpClient';

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

const apiRequestMock = vi.mocked(apiRequest);

describe('campuses API', () => {
  beforeEach(() => {
    apiRequestMock.mockReset();
  });

  it('loads the public campus catalog from the backend source of truth', () => {
    void listPublicCampuses();

    expect(apiRequestMock).toHaveBeenCalledWith('/public/campuses');
  });
});
