Files
coder/site/test/setup/mocks.ts
T
Ehab Younes a581431bc8 fix(site): show apps with disabled health status on workspaces list (#21428)
- Fix to display apps with disabled health status on workspaces list
- Migrate WorkspacesPage jest test into vitest
- Modularize vitest setup into separate files:
  - setup/polyfills.ts: Blob, ResizeObserver polyfills
  - setup/domStubs.ts: Radix UI pointer capture stubs
  - setup/mocks.ts: useProxyLatency mock
  - setup/msw.ts: MSW server lifecycle

Fixed #20319
2026-01-12 13:37:30 +03:00

12 lines
419 B
TypeScript

// Mock useProxyLatency to avoid real network requests to external proxy URLs.
// Must use useMemo to return stable object references and prevent infinite re-renders.
vi.mock("contexts/useProxyLatency", async () => {
const { useMemo } = await import("react");
return {
useProxyLatency: () => {
const proxyLatencies = useMemo(() => ({}), []);
return { proxyLatencies, refetch: () => new Date() };
},
};
});