Files
Agent-System/web/src/hooks/useAuthenticatedWorkspaceSync.test.ts
T
WeiCHEN 6d3efdf4d7 feat(auth): show real names in duty pickers and enable profile edits
Add a login-visible user directory API and admin/self profile update
paths so project duty selectors stop falling back to "用户 N", and so
users can persist display fields with an admin-edit tip.
2026-09-23 09:39:41 +08:00

19 lines
927 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);
assert.equal(hook.includes('fetchUserDirectory'), true);
assert.equal(hook.includes('setAllUsers'), true);
assert.equal(app.includes('setAllUsers'), true);
});