refactor: inline buildPrevYearTotalMap and simplify tests (#39) #40

Merged
maximus merged 1 commit from fix/simpl-resultat-39-simplify-budget into main 2026-03-11 21:34:36 +00:00
Collaborator

Fixes #39

Summary

  • Inlined the trivial buildPrevYearTotalMap helper (3 lines of logic) directly into useBudget's refreshData
  • Removed the exported function and the 50-line test file that was disproportionate for a simple filter-and-set loop
  • No behavioral change — the inline code is identical to the extracted function

Test plan

  • npm test passes (17 tests)
  • Verify budget page still shows previous year totals correctly
Fixes #39 ## Summary - Inlined the trivial `buildPrevYearTotalMap` helper (3 lines of logic) directly into `useBudget`'s `refreshData` - Removed the exported function and the 50-line test file that was disproportionate for a simple filter-and-set loop - No behavioral change — the inline code is identical to the extracted function ## Test plan - [x] `npm test` passes (17 tests) - [ ] Verify budget page still shows previous year totals correctly
medic-bot added 1 commit 2026-03-11 17:03:08 +00:00
The 3-line helper was exported solely for testing. Inlining it removes the
export-for-test pattern and eliminates 50 lines of tests that were
disproportionate for a trivial filter-and-set loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Collaborator

Reviewer automatique — approved

Le refactoring est correct et fidèle à l'issue #39. La fonction triviale buildPrevYearTotalMap est inlinée comme suggéré, les tests unitaires disproportionnés sont supprimés, et la logique est préservée à l'identique. Le commentaire inline remplace adéquatement le JSDoc supprimé.

## Reviewer automatique — approved Le refactoring est correct et fidèle à l'issue #39. La fonction triviale buildPrevYearTotalMap est inlinée comme suggéré, les tests unitaires disproportionnés sont supprimés, et la logique est préservée à l'identique. Le commentaire inline remplace adéquatement le JSDoc supprimé.
maximus merged commit 99fdf4f9ea into main 2026-03-11 21:34:36 +00:00
maximus deleted branch fix/simpl-resultat-39-simplify-budget 2026-03-11 21:34:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: maximus/Simpl-Resultat#40
No description provided.