Skip to content

fix: add budget entry input validation#6

Merged
zhihuangzheng22-spec merged 2 commits intomasterfrom
fix-budget-entry-validation
May 2, 2026
Merged

fix: add budget entry input validation#6
zhihuangzheng22-spec merged 2 commits intomasterfrom
fix-budget-entry-validation

Conversation

@zhihuangzheng22-spec
Copy link
Copy Markdown
Collaborator

Implemented input validation for budget entries.

Changes:

  • Added validateEntryInput() to check title and amount
  • Rejected blank titles and titles containing only spaces
  • Rejected zero, negative, and invalid amounts
  • Reused the same validation helper for both income and expense entries
  • Added validation messages for English, Chinese, and Japanese

Testing:

  • Empty title is rejected
  • Space-only title is rejected
  • Amount 0 is rejected
  • Negative amount is rejected
  • Valid income and expense entries can still be added normally
  • Language switching still works

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zhihuangzheng22-spec zhihuangzheng22-spec merged commit b8a52ee into master May 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants