Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

harden the Settings redirect test's api mock against a thenable namespace

[._.]/ Adam Eivycb8071d5b117
diff --git a/client/src/pages/Settings.redirects.test.jsx b/client/src/pages/Settings.redirects.test.jsx
index 2915181048..f072049e65 100644
--- a/client/src/pages/Settings.redirects.test.jsx
+++ b/client/src/pages/Settings.redirects.test.jsx
@@ -2,7 +2,14 @@ import { describe, expect, it, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import { MemoryRouter, Route, Routes, useLocation } from 'react-router';
-vi.mock('../services/api', () => new Proxy({}, { get: () => vi.fn().mockResolvedValue({}) }));
+// Settings.jsx imports every tab component, and those pull in the API client.
+// Stub the whole module so no tab's import-time wiring reaches the network. The
+// Proxy answers any named import with a resolved-promise spy; `then` must stay
+// undefined or Vitest's `await` on the factory result treats the namespace as a
+// thenable and hangs waiting for a resolve that never comes.
+vi.mock('../services/api', () => new Proxy({}, {
+ get: (_target, key) => (key === 'then' || key === '__esModule' ? undefined : vi.fn().mockResolvedValue({})),
+}));
const Settings = (await import('./Settings')).default;