test: count a manual transaction's link in the whole-history summary (#522)
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 3m25s

Review 32761: excluding transactions without a file_id from the
delete-all count stayed green, while unlinkAndDeleteAllImports removes
those links for good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-11-08 20:24:53 -05:00
commit fc077d49a7

View file

@ -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 () => {