feat(FN-5413): add null description persist regression test
Added a regression test for null description persistence in the core task store and a CLI patch changeset to ship the fix. Fusion-Task-Id: FN-5413
This commit is contained in:
committed by
gsxdsm
parent
f236dc3982
commit
a04ba3cf21
5
.changeset/fn-5413-null-description-persist.md
Normal file
5
.changeset/fn-5413-null-description-persist.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Coerce null or undefined `task.description` values to an empty string when persisting TaskStore rows.
|
||||
@@ -35,6 +35,27 @@ describe("TaskStore", () => {
|
||||
const createSourceIssueFixture = () => harness.createSourceIssueFixture();
|
||||
const insertLogEntryWithTimestamp = (...args: any[]) => (harness as any).insertLogEntryWithTimestamp(...args);
|
||||
|
||||
describe("FN-5413 null description coercion", () => {
|
||||
it.each([
|
||||
["undefined", undefined],
|
||||
["null", null],
|
||||
])("coerces %s description to empty string on persist", async (_label, description) => {
|
||||
const created = await store.createTask({
|
||||
description: "Initial description",
|
||||
});
|
||||
|
||||
const task = await store.getTask(created.id);
|
||||
(task as Task & { description?: string | null }).description = description;
|
||||
|
||||
expect(() => {
|
||||
(store as unknown as { upsertTaskWithFtsRecovery: (task: Task) => void }).upsertTaskWithFtsRecovery(task);
|
||||
}).not.toThrow();
|
||||
|
||||
const persisted = await store.getTask(created.id);
|
||||
expect(persisted.description).toBe("");
|
||||
});
|
||||
});
|
||||
|
||||
describe("breakIntoSubtasks task creation flag", () => {
|
||||
it("persists breakIntoSubtasks=true when explicitly requested", async () => {
|
||||
const task = await store.createTask({
|
||||
|
||||
Reference in New Issue
Block a user