+
返回对话
-
- {notice !== null && (
-
-
- {notice}
-
- )}
-
-
- {!ready && (
-
- 报告生成完成后才能打印,请稍候。
-
- )}
);
}
diff --git a/frontend/tests/personal-report-view.test.ts b/frontend/tests/personal-report-view.test.ts
index a6cbd95d..feddd49a 100644
--- a/frontend/tests/personal-report-view.test.ts
+++ b/frontend/tests/personal-report-view.test.ts
@@ -227,13 +227,13 @@ test("canonical contract rejects malformed documents", () => {
assert.equal(safeParseReportDocument(badRefs).ok, false, "dangling evidenceRefs must fail guards");
});
-test("print button is gated on ready state (source contract)", () => {
+test("PDF action is hidden while the export format is unavailable", () => {
const actionsSource = readFileSync(
new URL("../src/components/personal-report/report-actions.tsx", import.meta.url),
"utf8",
);
- assert.match(actionsSource, /const disabled = !ready \|\| busy \|\| !isPrintSupported\(\)/);
- assert.match(actionsSource, /disabled=\{disabled\}/);
- assert.match(actionsSource, /printPersonalReport/);
- assert.match(actionsSource, /personal-report-screen-only/);
+ assert.match(actionsSource, /返回对话/);
+ assert.doesNotMatch(actionsSource, /打印 \/ 保存为 PDF/);
+ assert.doesNotMatch(actionsSource, /printPersonalReport/);
+ assert.doesNotMatch(actionsSource, /Printer/);
});