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

test: give the rich-authoring browser suite's settings mock the settingsEvents export

[._.]/ Adam Eivy6f1147de7c94
diff --git a/server/routes/musicVideoRichAuthoring.browser.test.js b/server/routes/musicVideoRichAuthoring.browser.test.js
index 59810abc02..3c6a6447bb 100644
--- a/server/routes/musicVideoRichAuthoring.browser.test.js
+++ b/server/routes/musicVideoRichAuthoring.browser.test.js
@@ -21,7 +21,8 @@ vi.mock('../lib/paths.js', async original => makePathsProxy(await original(), {
vi.mock('../services/instanceIdentity.js', () => ({ ensureInstanceId: async () => 'synthetic-instance' }));
// Accepting a document starts a background overlay text check (its own browser); this suite pins the authoring UI.
vi.mock('../services/musicVideo/overlayTextService.js', () => ({ checkOverlayTextInBackground: () => {}, startOverlayTextCheck: async () => { throw new Error('not in this suite'); } }));
-vi.mock('../services/settings.js', () => ({ getSettings: async () => ({}) }));
+// authGate (reached from the accept route's host-control check) subscribes to settingsEvents at import.
+vi.mock('../services/settings.js', async () => ({ getSettings: async () => ({}), settingsEvents: new (await import('node:events')).EventEmitter() }));
vi.mock('../services/auth.js', () => ({ isAuthEnabled: async () => true, verifyRequestSessionIdentity: async () => ({ kind: 'session', sessionId: 'synthetic-browser', label: null }) }));
let endpoint;
vi.mock('../services/browserService.js', () => ({ loadConfig: async () => ({ chromePath: chrome }), cdpRequest: path => fetch(`${endpoint}${path}`) }));