Files
Agent-System/web/src/hooks/useAuthenticatedWorkspaceSync.test.ts
T
weichenandCursor 27c1be86d5 refactor(web): move login workspace sync out of App
Project list, member roster, and session fetch ran as four effects inside the workbench component. They now share one hook so the entry file is not the only place that knows the login startup order.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 11:05:29 +00:00

16 lines
765 B
TypeScript

import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import test from 'node:test';
test('login workspace sync lives in one hook', () => {
const app = readFileSync(new URL('../App.tsx', import.meta.url), 'utf8');
const hook = readFileSync(new URL('./useAuthenticatedWorkspaceSync.ts', import.meta.url), 'utf8');
assert.equal((app.match(/useAuthenticatedWorkspaceSync\(/g) || []).length, 1);
assert.equal(app.includes('fetchProjects('), false);
assert.equal(app.includes('fetchChatSessions('), false);
assert.equal(hook.includes('fetchProjects'), true);
assert.equal(hook.includes('fetchChatSessions'), true);
assert.equal(hook.includes('loginMemberSyncIds'), true);
assert.equal(hook.includes('.fetchMe()'), true);
});