import { describe, expect, it, vi } from 'vitest'; vi.mock('./client', () => ({ getJson: vi.fn() })); import { getJson } from './client'; import { loadDashboard } from './dashboardApi'; describe('loadDashboard', () => { it('builds encoded endpoint path and delegates to getJson', async () => { vi.mocked(getJson).mockResolvedValue({ ok: true }); await loadDashboard('demo context/1'); expect(getJson).toHaveBeenCalledWith('/api/customer/orders/status?contextId=demo%20context%2F1'); }); });