diff --git a/src/__integration__/unlink-and-delete-import.test.ts b/src/__integration__/unlink-and-delete-import.test.ts index 7852a87..ede495c 100644 --- a/src/__integration__/unlink-and-delete-import.test.ts +++ b/src/__integration__/unlink-and-delete-import.test.ts @@ -99,17 +99,24 @@ describe("getLinkedTransfersSummary (#522)", () => { ]); }); - it("counts every transfer of the profile for the whole history", async () => { + it("counts every transfer of the profile for the whole history, a manual transaction's link included", async () => { const a = seedImport("Desjardins", 3); const b = seedImport("Tangerine", 3); link("CELI", a.txIds[0]); link("REER", a.txIds[0]); link("CELI", b.txIds[2]); + // Entered by hand, no import: "delete all" removes it and its link too. + const manual = Number( + db + .prepare("INSERT INTO transactions (date, description, amount) VALUES ('2026-02-01', 'Manuelle', -10)") + .run().lastInsertRowid, + ); + link("Compte non-enregistré", manual); const summary = await getLinkedTransfersSummary({ kind: "all" }); - expect(summary.transferCount).toBe(3); - expect(summary.accounts.map((x) => x.account_name)).toEqual(["CELI", "REER"]); + expect(summary.transferCount).toBe(4); + expect(summary.accounts.map((x) => x.account_name)).toEqual(["CELI", "Compte non-enregistré", "REER"]); }); it("marks an archived account as inactive", async () => {