[PR #3183] [MERGED] Add unit tests for goal template types #4728

Closed
opened 2026-02-28 21:00:20 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3183
Author: @ACWalker
Created: 8/3/2024
Status: Merged
Merged: 8/5/2024
Merged by: @MikesGlitch

Base: masterHead: add_unit_tests_for_goals


📝 Commits (4)

  • a1d0f93 Add unit tests for each goal type
  • 052b77c Add test for goals schedule template
  • 62c77ae Merge branch 'master' into add_unit_tests_for_goals
  • c761cd4 Update release notes

📊 Changes

9 files changed (+949 additions, -0 deletions)

View changed files

packages/loot-core/src/server/budget/goals/goalsAverage.test.ts (+89 -0)
packages/loot-core/src/server/budget/goals/goalsBy.test.ts (+134 -0)
packages/loot-core/src/server/budget/goals/goalsPercentage.test.ts (+180 -0)
packages/loot-core/src/server/budget/goals/goalsRemainder.test.ts (+79 -0)
packages/loot-core/src/server/budget/goals/goalsSchedule.test.ts (+85 -0)
packages/loot-core/src/server/budget/goals/goalsSimple.test.ts (+147 -0)
packages/loot-core/src/server/budget/goals/goalsSpend.test.ts (+105 -0)
packages/loot-core/src/server/budget/goals/goalsWeek.test.ts (+124 -0)
upcoming-release-notes/3183.md (+6 -0)

📄 Description

This PR adds unit tests for the various goal template types, which helps address this issue #1686. I hope this will help to improve the robustness of the templates going forward.

For each goal template type, I have created a file containing the unit tests for that template type. I've tried to cover as many of the potential scenarios as possible, but there will definitely be some scenarios I haven't covered, this is just to get the ball rolling.

While writing these tests I have found some areas in the goal templates that we can refactor and improve, which I can address in subsequent PRs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/3183 **Author:** [@ACWalker](https://github.com/ACWalker) **Created:** 8/3/2024 **Status:** ✅ Merged **Merged:** 8/5/2024 **Merged by:** [@MikesGlitch](https://github.com/MikesGlitch) **Base:** `master` ← **Head:** `add_unit_tests_for_goals` --- ### 📝 Commits (4) - [`a1d0f93`](https://github.com/actualbudget/actual/commit/a1d0f93f47df01b25f1309d6f089d89d9928a730) Add unit tests for each goal type - [`052b77c`](https://github.com/actualbudget/actual/commit/052b77c3d888778900537c171afa0fa55ce18d6b) Add test for goals schedule template - [`62c77ae`](https://github.com/actualbudget/actual/commit/62c77aefe4ef298882d6c24e704785df2ea849ee) Merge branch 'master' into add_unit_tests_for_goals - [`c761cd4`](https://github.com/actualbudget/actual/commit/c761cd4533e695c2d300ca9779e6d78977df7c50) Update release notes ### 📊 Changes **9 files changed** (+949 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `packages/loot-core/src/server/budget/goals/goalsAverage.test.ts` (+89 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsBy.test.ts` (+134 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsPercentage.test.ts` (+180 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsRemainder.test.ts` (+79 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsSchedule.test.ts` (+85 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsSimple.test.ts` (+147 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsSpend.test.ts` (+105 -0) ➕ `packages/loot-core/src/server/budget/goals/goalsWeek.test.ts` (+124 -0) ➕ `upcoming-release-notes/3183.md` (+6 -0) </details> ### 📄 Description This PR adds unit tests for the various goal template types, which helps address this issue #1686. I hope this will help to improve the robustness of the templates going forward. For each goal template type, I have created a file containing the unit tests for that template type. I've tried to cover as many of the potential scenarios as possible, but there will definitely be some scenarios I haven't covered, this is just to get the ball rolling. While writing these tests I have found some areas in the goal templates that we can refactor and improve, which I can address in subsequent PRs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:00:20 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4728