Something went wrong. Try again.
Convert CSV banking statements to hledger journals
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132import assert from "assert";import { summaryText } from "./summary.js";
// The state payload's names are the server's, so they are quoted as such.const state = { configured: true, file: "sept.csv", "history_ok": true, "history_pairs": 2, "shown_rows": 1, "total_rows": 3,};
Deno.test("M1-UI-005: the summary names the import and how many of its rows are shown", () => { assert.equal(summaryText(state), "sept.csv · 1 of 3 rows shown · 2 historical pair(s), all matching");});
Deno.test("M1-UI-005: with no current import, the summary says so", () => { assert.equal(summaryText({ ...state, file: "" }).split(" · ")[0], "no current import");});
Deno.test("M1-UI-011: an incomplete configuration is said up front", () => { assert.equal( summaryText({ ...state, configured: false }), "sept.csv · configuration incomplete · 1 of 3 rows shown · 2 historical pair(s), all matching", );});
Deno.test("M1-UI-013: a history that does not match says so", () => { assert.match(summaryText({ ...state, "history_ok": false }), / · 2 historical pair\(s\), with differences$/);});