Locate render diagnostics by tree node id and expect published DHF rules
Why: Browser acceptance (/tmp/renderer-browser-acceptance/20261017T061021Z) found §11-4 showed 25/25 diagnostics as 未定位节点 because the renderer nodeId is the canonical mapping id (pp.cover.document-number.value) while the workspace tree uses dn-… ids; RDM now adds treeNodeId to every diagnostic. §11-3 failed only because the e2e spec still expected 已验证/未发布 although all 44 DHF profiles are published. Evidence: npx tsc --noEmit exit 0; npx vitest run 39 files / 445 tests passed (4 new in test/document-render-workspace.test.ts covering treeNodeId, nodeId fallback, unknown ids and per-node counts); npm run build ok; node scripts/check-knip.mjs unused exports 51 <= 51; e2e/document-renderer.playwright.ts type-checks (tsc exit 0) and playwright test --list loads 13 tests. Real rdm.render.profiles payload in evidence/network/item3-author.jsonl: template rule state=published, publicationAllowed=true, no blockedReason, refusal controlled_requires_exact_profile. Impact: normalizeDiagnostics keeps treeNodeId; locateDiagnostic resolves treeNodeId first and falls back to nodeId, otherwise the diagnostic stays explicitly unlocated. Badges and the 有诊断问题 filter count by the located tree node. Clicking a located diagnostic selects the node and scrolls it into view in canvas or reader, also on a repeated click. Diagnostics loading keeps its single request guard. §11-3 now asserts 已发布, 可正式交付, an enabled option and no reason, and still asserts source, version, the no-fallback notice and refusal. Not run against a live backend or browser here. Refs: unified renderer plan Task 13 §11 items 3 and 4; spec 10 §11 item 3; summary.md root causes §A and §B. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -279,8 +279,11 @@ test('§11-3 受控文档:规则来源、版本与不回退说明', async ({ b
|
||||
await expect(option.locator('.drw-profile-source')).toHaveText('模板规则')
|
||||
await expect(option.locator('.drw-profile-id')).toHaveText(TEMPLATE_PROFILE)
|
||||
await expect(option.locator('.drw-profile-ver')).toHaveText(`v${env('RBA_TEMPLATE_VERSION')}`)
|
||||
await expect(option.locator('.ui-chip').first()).toHaveText('已验证')
|
||||
await expect(option.locator('.drw-profile-reason')).toContainText('未发布')
|
||||
// 44 个 DHF 专用规则均已发布(state=published、publicationAllowed=true):状态为已发布,可正式交付,无未发布原因。
|
||||
await expect(option.locator('.ui-chip').first()).toHaveText('已发布')
|
||||
await expect(option.locator('.ui-chip', { hasText: '可正式交付' })).toBeVisible()
|
||||
await expect(option.locator('input[type="radio"]')).toBeEnabled()
|
||||
await expect(option.locator('.drw-profile-reason')).toHaveCount(0)
|
||||
await expect(rules.locator('.drw-notice')).toContainText('不会回退到项目或公司默认规则')
|
||||
await expect(rules.locator('.drw-failure-msg')).toContainText('不得回退到项目或公司默认规则')
|
||||
await expectReadableFailures(page)
|
||||
|
||||
Reference in New Issue
Block a user