chore(balance): post-merge cleanup of #182-#185 reviews (#187) #195
2 changed files with 9 additions and 1 deletions
|
|
@ -73,6 +73,13 @@ describe("getStarterCollisions", () => {
|
||||||
expect(result.has("tfsa")).toBe(false);
|
expect(result.has("tfsa")).toBe(false);
|
||||||
expect(result.has("cash")).toBe(false); // name "CELI" != "Compte chèque"
|
expect(result.has("cash")).toBe(false); // name "CELI" != "Compte chèque"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("excludes archived accounts via SQL filter", async () => {
|
||||||
|
mockSelect.mockResolvedValueOnce([]);
|
||||||
|
await getStarterCollisions();
|
||||||
|
const sql = mockSelect.mock.calls[0][0];
|
||||||
|
expect(sql).toMatch(/archived_at IS NULL/);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("proposeStarterAccounts", () => {
|
describe("proposeStarterAccounts", () => {
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,8 @@ export async function getStarterCollisions(): Promise<Set<string>> {
|
||||||
`SELECT c.key AS key, a.name AS account_name
|
`SELECT c.key AS key, a.name AS account_name
|
||||||
FROM balance_accounts a
|
FROM balance_accounts a
|
||||||
INNER JOIN balance_categories c ON c.id = a.balance_category_id
|
INNER JOIN balance_categories c ON c.id = a.balance_category_id
|
||||||
WHERE c.key IN ('cash','tfsa','rrsp','other')`
|
WHERE c.key IN ('cash','tfsa','rrsp','other')
|
||||||
|
AND a.archived_at IS NULL`
|
||||||
);
|
);
|
||||||
const collisions = new Set<string>();
|
const collisions = new Set<string>();
|
||||||
for (const starter of STARTER_ACCOUNTS) {
|
for (const starter of STARTER_ACCOUNTS) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue