diff --git a/src/__integration__/restore.test.ts b/src/__integration__/restore.test.ts index 115ce4f..bbca03e 100644 --- a/src/__integration__/restore.test.ts +++ b/src/__integration__/restore.test.ts @@ -483,6 +483,9 @@ describe("restoring a profile that holds a Bilan transfer (#521)", () => { // As « Lier transferts » links them, by the real service. await linkTransfer(CELI, contribution, "in", "Cotisation d'octobre"); await linkTransfer(REER, withdrawal, "out"); + // Dates of creation set apart from the clock: a restore that wrote its own would show. + profile.prepare("UPDATE balance_account_transfers SET created_at = '2026-10-04 09:15:00' WHERE id = 1").run(); + profile.prepare("UPDATE balance_account_transfers SET created_at = '2026-10-06 18:30:00' WHERE id = 2").run(); transfersBefore = transfersOf(profile); expect(transfersBefore.map((t) => [t.id, t.account_id, t.transaction_id, t.direction])).toEqual([ [1, CELI, contribution, "in"], @@ -565,12 +568,13 @@ describe("restoring a profile that holds a Bilan transfer (#521)", () => { [], ], [ - "its rows do not keep their ids (two share one, no split line)", + // The two linked rows come back unchanged in the file, but SQLite renumbers every row. + "its rows do not keep their ids (« PAIE » bears the id of « LOYER », no split line)", (data) => ({ ...data, transactions: (data.transactions ?? []) .filter((tx) => tx.parent_transaction_id === null) - .map((tx) => (tx.id === 7 ? { ...tx, id: 6 } : { ...tx, is_split: 0 })), + .map((tx) => ({ ...tx, id: tx.id === 3 ? 2 : tx.id, is_split: 0 })), }), [], ],