Template bodies were read-only, but the status chip said 编制中 and the lock banner said the document was already controlled. Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
736 B
TypeScript
12 lines
736 B
TypeScript
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import test from 'node:test';
|
|
|
|
test('template documents are labeled as preview, not 编制中 or 已生效受控', () => {
|
|
const bar = readFileSync(new URL('../components/doc/DocGovActionBar.tsx', import.meta.url), 'utf8');
|
|
const blocks = readFileSync(new URL('../components/doc/BlockRenderer.tsx', import.meta.url), 'utf8');
|
|
assert.equal(bar.includes("ast.lifecycleState === 'template'\n ? '模板预览'"), true);
|
|
assert.equal(blocks.includes('任务未完成,正文仍为模板预览。完成编写任务后,编制人才能编辑正文。'), true);
|
|
assert.equal(blocks.includes("lifecycleState === 'template'"), true);
|
|
});
|