建档改为四步。帮别人看写入已有人物档案,不新增数据库列。本人没有出生资料时不显示今日星语,「和我合盘」改成一句说明。起步三问只读已有上升和月亮:前两问直接发送,第三问只聚焦输入框。 自测:tsc 退出码 0;lint 0 error、121 warning;定向测试 142 项,pass 142,fail 0,cancelled 0;build 成功,/ 仍是 Static。首屏 gzip 592895,相对基线 578435 为 +2.50%。未跑全量 npm test、Python 快速门和 test:db。 Co-Authored-By: Grok (agent loop)
17 lines
908 B
TypeScript
17 lines
908 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
const page = readFileSync(new URL("../src/app/(app)/page.tsx", import.meta.url), "utf8");
|
|
const shell = readFileSync(new URL("../src/components/home-onboarding-shell.tsx", import.meta.url), "utf8");
|
|
|
|
test("loads birth-time rectification only when its onboarding stage is reached", () => {
|
|
// 原值: 引导屏 dynamic() 加载 BirthTimeRectification。
|
|
// 新值: 引导屏不再包含 BirthTimeRectification;首页仍挂载 ConversationalBirthTimeRectification。
|
|
// 原因: BUG-1431,建档里的校正卡是死代码,校正只从对话进入。
|
|
assert.match(page, /<HomeOnboardingShell/);
|
|
assert.match(page, /<ConversationalBirthTimeRectification/);
|
|
assert.doesNotMatch(shell, /BirthTimeRectification/);
|
|
assert.doesNotMatch(shell, /onboardingStep === "rectification"/);
|
|
});
|