[GH-ISSUE #1686] [Tech Debt] Automated tests for goal templates #42288

Closed
opened 2026-04-26 01:58:09 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @shall0pass on GitHub (Sep 11, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/1686

Verified feature request does not already exist?

  • I have searched and found no existing issue

💻

  • Would you like to implement this feature?

Pitch: what problem are you trying to solve?

There are a lot of possible variations when using goal templates because there can be multiple templates in a single category. The goal templates could use a test suit to test all of the various conditions and to verify there aren't any regressions. This would provide a repeatable method of testing. As it is currently, the testing is a manual process.

Describe your ideal solution to this problem

No response

Teaching and learning

No response

Originally created by @shall0pass on GitHub (Sep 11, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/1686 ### Verified feature request does not already exist? - [X] I have searched and found no existing issue ### 💻 - [ ] Would you like to implement this feature? ### Pitch: what problem are you trying to solve? There are a lot of possible variations when using goal templates because there can be multiple templates in a single category. The goal templates could use a test suit to test all of the various conditions and to verify there aren't any regressions. This would provide a repeatable method of testing. As it is currently, the testing is a manual process. ### Describe your ideal solution to this problem _No response_ ### Teaching and learning _No response_
GiteaMirror added the tech debtgoal templatesgood first issue labels 2026-04-26 01:58:10 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 11, 2023):

Thanks for sharing your idea!

This repository uses lodash style issue management for enhancements. That means enhancement issues are automatically closed. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution).

The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!

<!-- gh-comment-id:1714458444 --> @github-actions[bot] commented on GitHub (Sep 11, 2023): :sparkles: Thanks for sharing your idea! :sparkles: This repository uses lodash style issue management for enhancements. That means enhancement issues are automatically closed. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution). The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+ Don’t forget to upvote the top comment with 👍! <!-- feature-auto-close-comment -->
Author
Owner

@LarsStegman commented on GitHub (Sep 25, 2023):

In my opinion this is a must. Especially since the implementation of the goals should definitely be improved. The currently implementation in goalTemplates.ts is a mess, to be brutally honest. A good test suite will prevent any regressions during the refactoring.

This would be the ideal place to apply the strategy pattern

<!-- gh-comment-id:1734214532 --> @LarsStegman commented on GitHub (Sep 25, 2023): In my opinion this is a must. Especially since the implementation of the goals should definitely be improved. The currently implementation in [goalTemplates.ts](https://github.com/actualbudget/actual/blob/master/packages/loot-core/src/server/budget/goaltemplates.ts) is a mess, to be brutally honest. A good test suite will prevent any regressions during the refactoring. This would be the ideal place to apply the [strategy pattern](https://refactoring.guru/design-patterns/strategy)
Author
Owner

@joel-jeremy commented on GitHub (Jul 17, 2024):

I think this should not be a feature request but an ongoing sort of thing. Like it shouldn't be tucked away in the feature requests but front and center in the issues page so that possible contributors will have visibility that more tests are needed for the project.

<!-- gh-comment-id:2232472996 --> @joel-jeremy commented on GitHub (Jul 17, 2024): I think this should not be a feature request but an ongoing sort of thing. Like it shouldn't be tucked away in the feature requests but front and center in the issues page so that possible contributors will have visibility that more tests are needed for the project.
Author
Owner

@youngcw commented on GitHub (Jul 17, 2024):

Moved from feature -> issue

<!-- gh-comment-id:2233456382 --> @youngcw commented on GitHub (Jul 17, 2024): Moved from feature -> issue
Author
Owner

@youngcw commented on GitHub (Nov 5, 2024):

This should be easier now that the template code is better consolidated. We need tests, mostly for the processing functions.

As a basis for testing Ive attached my testing budget that includes templates and expected budget amounts for the categories. Amounts are only correct if run in Aug 2023.
template.zip

<!-- gh-comment-id:2458276795 --> @youngcw commented on GitHub (Nov 5, 2024): This should be easier now that the template code is better consolidated. We need tests, mostly for the processing functions. As a basis for testing Ive attached my testing budget that includes templates and expected budget amounts for the categories. Amounts are only correct if run in Aug 2023. [template.zip](https://github.com/user-attachments/files/17639446/template.zip)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#42288