import assert from 'node:assert/strict' import test from 'node:test' import { readSourceFile } from './helpers/sourceSurface.mjs' const workspace = readSourceFile('components/approval/ApprovalTaskWorkspace.vue') const documentsCenter = readSourceFile('views/DocumentsCenterView.vue') const appShell = readSourceFile('views/AppShellRouteView.vue') test('approval task workspace wires every server-authorized action to a real mutation', () => { assert.match(workspace, /approveApprovalTask/) assert.match(workspace, /returnApprovalTask/) assert.match(workspace, /escalateApprovalTask/) assert.match(workspace, / { assert.match(workspace, /resolveApprovalTaskRetryKey/) assert.match(workspace, /previousFingerprint: requestFingerprint\.value/) assert.match(workspace, /previousRequestId: requestId\.value/) assert.match(workspace, /payload\.requestId = retryKey\.requestId/) assert.match(workspace, /expectedTaskVersion: Number\(activeTask\.value\.version\)/) assert.match(workspace, /mutation\?\.replayed[\s\S]*结果已安全重放/) assert.match(workspace, /await queueRef\.value\?\.reload\?\.\(\)/) }) test('documents review tab owns the task workspace and propagates updates to the app shell', () => { assert.match(documentsCenter, / { assert.match(workspace, /service\(\{ status: 'pending', page: 1, pageSize: 1 \}\)/) assert.match(workspace, /@loaded="handleQueueLoaded"/) assert.match(workspace, /void loadTaskSummary\(\)[\s\S]*emit\('batch-result', result\)/) assert.match(workspace, /emit\('request-updated', \{ claim: claims\[0\], claimId: claimIds\[0\], claimIds \}\)/) assert.match(workspace, /const workspaceError = computed\(\(\) => queueError\.value \|\| summaryError\.value\)/) })