|
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 1m43s
First link of the import-format stack. `autoDetectConfig`, `detectAmountMode`, `detectSingleAmount`, `preprocessQuotedCSV` and `parseFrenchAmount` had no test at all on a suite of 871, while carrying every imported amount. This adds the reference the rewrite (#323-#332) measures itself against, before any of it moves. Corpus — 11 synthetic files under `src/__fixtures__/csv/`, no real statement data, covering shapes a single real statement never contains at once: signed amount, debit/credit, debit/credit in reversed column order, unused column filled with `0,00`, preamble before the header, header carrying a number, header cell starting with digits, no header row, all-positive amounts, whole-line-quoted (Desjardins style), absolute amount + D/C indicator. Every expectation was derived by running the code, not by reading it. Four cases are frozen as DEFECTIVE, each named `KNOWN DEFECT` with the right answer in a comment and the issue that owes the fix: - reversed debit/credit — the pair is assigned by column position, never by label, so every sign is inverted while the total merely negates (#328) - unused column at `0,00` — the rule branches on `isNaN(credit)` and `"0,00"` parses to 0, so every debit imports as zero (#325) - header cell starting with digits — `parseFloat` returns the numeric prefix, `detectHeader` reads the header as data (#328/#325) - absolute amount + D/C indicator — the indicator column is ignored entirely and every credit imports as an expense (#328) `parseFrenchAmount` is pinned form by form, including the prefix-scan defect the spec flagged: `"100,00 CAD"` yields 10000 and passes `isNaN`. Per the /review-spec revision, the assertions reach the holdings call sites too, which surfaced the same x100 leak in the #245 holdings import — a price cell of `"150,25 CAD"` stores the position at 15025. The end-to-end tests replay the wizard's row-mapping rule from a mirror, since it still lives inside a `useCallback` and the repo has no jsdom. A guard test asserts the production expressions are still literally present, so the mirror cannot drift; #325 extracts `mapRow` and must then delete it. No production file is modified. 924 vitest green (was 871), build clean. Resolves #326 |
||
|---|---|---|
| .. | ||
| __fixtures__ | ||
| __integration__ | ||
| components | ||
| contexts | ||
| data | ||
| hooks | ||
| i18n | ||
| pages | ||
| services | ||
| shared | ||
| utils | ||
| App.tsx | ||
| main.tsx | ||
| styles.css | ||
| vite-env.d.ts | ||