Skip to content

Fix failing tests: savings tab rename + frequency utility#32

Merged
kryptodrex merged 4 commits intoissue-fixesfrom
copilot/fix-test-case-issue
Mar 12, 2026
Merged

Fix failing tests: savings tab rename + frequency utility#32
kryptodrex merged 4 commits intoissue-fixesfrom
copilot/fix-test-case-issue

Conversation

Copy link

Copilot AI commented Mar 12, 2026

Three CI tests were failing on issue-fixes due to an unupdated test after an intentional tab rename and a behavioral regression introduced during a refactor of bill frequency logic.

Summary

  • tabManagement.ts: Renamed benefits tab → savings (order: 3), shifted loans to order 4. Added normalizeLegacyTabId() for backward-compat migration of persisted configs. Refactored initializeTabConfigs to sync canonical labels/icons from defaults while preserving user visibility/order state.
  • frequency.ts (new): Centralized frequency normalization and occurrences-per-year lookups for pay, bill, and savings frequencies. Handles aliases (biweekly, semiannual, annually, etc.) and input normalization (case, spacing, dash variants).
  • billFrequency.ts: Refactored to use getBillFrequencyOccurrencesPerYear. custom frequency explicitly returns amount * 12 — preserving original monthly semantics independent of the generic frequency utility's fallback of 1.
  • payPeriod.ts: getPaychecksPerYear now delegates to getPayFrequencyOccurrencesPerYear.
  • auth.ts: Added CoreFrequency, SavingsFrequency types; PayFrequency and BillFrequency now derived from CoreFrequency.
  • tabManagement.test.ts: Updated expected tab order to reflect savings/loans positions.
  • frequency.test.ts (new): 4 tests covering normalization, pay/bill/savings frequency lookups including aliases.

Result: 46 tests passing across 12 test files.

Type of Change

  • Bug fix
  • New feature
  • Refactor/cleanup
  • Documentation update
  • Build/release/config update

User-Facing Impact

  • This PR changes user-facing behavior
  • If user-facing behavior changed, I updated Features.md

Docs Checklist

  • I reviewed README.md and updated it for major functionality/architecture changes (if applicable)
  • I updated app_updates/APP_UPDATES.md for shipped/planned status changes (if applicable)

Validation

  • npm run lint
  • npx tsc --noEmit
  • Manual smoke test completed

Notes

  • normalizeLegacyTabId maps old benefits IDs → savings so existing persisted tab configs migrate cleanly on load.
  • getBillFrequencyOccurrencesPerYear('custom') intentionally returns 1 (no period given = unknown cadence); convertBillToYearly short-circuits before calling it so bill calculation semantics are unchanged.

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI and others added 2 commits March 12, 2026 14:47
@github-actions
Copy link

Version File Not Updated

The version file was not modified in this PR. Please update the version file in the root directory with the new version number.

Copilot AI changed the title [WIP] Fix the test case issue and improve reliability Fix failing tests: savings tab rename + frequency utility Mar 12, 2026
@kryptodrex kryptodrex marked this pull request as ready for review March 12, 2026 15:00
@kryptodrex kryptodrex changed the base branch from develop to issue-fixes March 12, 2026 15:00
@kryptodrex kryptodrex merged commit 9825127 into issue-fixes Mar 12, 2026
@kryptodrex kryptodrex deleted the copilot/fix-test-case-issue branch March 12, 2026 15:01
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