fix(onboarding): restore uncertain birth-time intake
Independent Staging Quality Gate / validate (push) Successful in 20m10s
Independent Staging Quality Gate / publish (push) Successful in 8m46s

This commit is contained in:
Jesse_Chen
2026-08-15 19:29:33 +08:00
parent 2984b6d1d0
commit 995da2d4b4
5 changed files with 110 additions and 18 deletions
@@ -206,18 +206,19 @@ test("unverified birth time no longer emits a modal or toast gate", () => {
assert.doesNotMatch(page, /role="alertdialog"[\s\S]{0,300}出生时间还没有完成校正/);
});
test("birth time intake only accepts one concrete initialization time", () => {
test("birth time intake starts with exact or uncertain choices and keeps rectification optional", () => {
const intake = readFileSync(new URL("../src/components/birth-time-intake.tsx", import.meta.url), "utf8");
const model = readFileSync(new URL("../src/lib/birth-time-intake-model.ts", import.meta.url), "utf8");
assert.match(model, /我知道准确出生时间/);
assert.match(intake, /请填写你初始化提供的具体出生时间/);
assert.match(model, /我不确定准确时间/);
assert.match(intake, /你对出生时间了解多少?/);
assert.match(intake, /不用猜具体分钟/);
assert.match(intake, /aria-label="选择出生时间"/);
assert.doesNotMatch(model, /我不确定准确时间/);
assert.doesNotMatch(intake, /source === "family_exact" \|\| source === "approximate"/);
assert.doesNotMatch(intake, /请选择最接近的时间范围/);
assert.doesNotMatch(intake, /完全不清楚,跳过出生时间/);
assert.doesNotMatch(intake, /生时校正以后需要时再做/);
assert.match(intake, /请选择最接近的时间范围/);
assert.match(intake, /完全不清楚,跳过出生时间/);
assert.match(intake, /生时校正以后需要时再做/);
});
test("homepage and profile result copy use the source-aware consultation options", () => {
+10 -4
View File
@@ -308,13 +308,19 @@ test("persisted birth dates normalize database ISO values without accepting inva
assert.equal(normalizePersistedBirthDate("1997-08-08junk"), "");
});
test("fresh intake only offers a concrete reported time and does not auto-confirm it", () => {
test("fresh intake preserves exact, approximate-period, and unknown-time paths without auto-confirming", () => {
const source = readFileSync(new URL("../src/components/birth-time-intake.tsx", import.meta.url), "utf8");
assert.deepEqual(birthTimeSourceOptions.map((option) => option.value), ["family_exact"]);
assert.deepEqual(
birthTimeSourceOptions.map((option) => option.value),
["family_exact", "period_only"],
);
assert.doesNotMatch(source, /已用于当前排盘/);
assert.doesNotMatch(source, /可能误差|选择误差范围|最接近的时间范围|大致时段|描述一个时间范围/);
assert.doesNotMatch(source, /birthTimePeriodOptions|birthTimeSource: "period_only"|birthTimeSource: "unknown"/);
assert.match(source, /birthTimePeriodOptions/);
assert.match(source, /birthTimeSource: "unknown"/);
assert.match(source, /请选择最接近的时间范围/);
assert.match(source, /完全不清楚,跳过出生时间/);
assert.match(source, /我可以描述一个时间范围/);
assert.match(source, /birthTimeStatus: "reported"/);
assert.match(source, /birthTimeConsultationOptionsCopy\(value\)/);
});