fix: keep unconfirmed candidates in rectification

This commit is contained in:
732642856
2026-07-21 16:06:30 +08:00
parent d82218e70a
commit 9154ec5ef1
6 changed files with 8 additions and 65 deletions
@@ -118,6 +118,8 @@ test("ready completion is explicit and terminal low has no finish mutation", ()
assert.doesNotMatch(hookSource, /turn\.nextAction\.kind === "ready"\) onReady/);
assert.match(candidateSource, /acknowledgeReady/);
assert.doesNotMatch(candidateSource, /controller\.finish/);
assert.doesNotMatch(hookSource, /completeGuidedBirthTimeCandidate/);
assert.doesNotMatch(hookSource, /completeCandidate:/);
});
test("unconfirmed terminal candidates preserve the range without offering direct adoption", () => {
+3 -2
View File
@@ -47,16 +47,17 @@ test("birth time intake requires only the fields selected by the source", () =>
assert.equal(isBirthTimeDraftReady({ ...emptyDraft, birthTimeSource: "unknown" }), true);
});
test("a persisted candidate working time can leave rectification onboarding", () => {
test("an unconfirmed candidate working time remains in rectification onboarding", () => {
const candidate = {
...emptyDraft,
time: "04:53",
birthTimeStatus: "candidate",
} satisfies BirthTimeDraft;
assert.equal(isBirthTimeReadyForConsultation(candidate), true);
assert.equal(isBirthTimeReadyForConsultation(candidate), false);
assert.equal(isBirthTimeReadyForConsultation({ ...candidate, time: "" }), false);
assert.equal(isBirthTimeReadyForConsultation({ ...candidate, birthTimeStatus: "rectifying" }), false);
assert.equal(isBirthTimeReadyForConsultation({ ...candidate, birthTimeStatus: "confirmed" }), true);
});
test("a persisted candidate working time takes precedence over the reported range", () => {