feat(jobs): complete workspace draft parity
CI and Deploy / test (pull_request) Successful in 5m4s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-15 17:34:32 +02:00
parent 3b86ea2da0
commit deed948183
28 changed files with 676 additions and 131 deletions
@@ -0,0 +1,24 @@
import {
extractApplicationAnswerDraft, removeApplicationAnswerDraft, upsertApplicationAnswerDraft,
} from "./applicationDrafts";
test("application answer helpers keep human notes separate", () => {
const stored = upsertApplicationAnswerDraft("Human note", " Draft answer ");
expect(stored).toBe("Human note\n\n<<<APPLICATION_ANSWER_DRAFT>>>\nDraft answer\n<<<END_APPLICATION_ANSWER_DRAFT>>>");
expect(extractApplicationAnswerDraft(stored)).toBe("Draft answer");
expect(removeApplicationAnswerDraft(stored)).toBe("Human note");
});
test("clearing an answer retains human notes and removes all marker blocks", () => {
const duplicated = "Human note\n\n<<<APPLICATION_ANSWER_DRAFT>>>\nFirst\n<<<END_APPLICATION_ANSWER_DRAFT>>>\n\n<<<APPLICATION_ANSWER_DRAFT>>>\nSecond\n<<<END_APPLICATION_ANSWER_DRAFT>>>";
expect(upsertApplicationAnswerDraft(duplicated, "")).toBe("Human note");
});
test("legacy application answer labels remain readable during migration", () => {
const legacy = "Human note\n\nApplication answer draft:\nLegacy answer";
expect(extractApplicationAnswerDraft(legacy)).toBe("Legacy answer");
expect(removeApplicationAnswerDraft(legacy)).toBe("Human note");
});