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); });