Skip to content

Fix recurring-date drift, add missing lib/e2e/a11y test coverage - #325

Closed
ndii-dev wants to merge 1 commit into
FlowwStar:mainfrom
ndii-dev:fix/stellar-wave-batch-1
Closed

Fix recurring-date drift, add missing lib/e2e/a11y test coverage#325
ndii-dev wants to merge 1 commit into
FlowwStar:mainfrom
ndii-dev:fix/stellar-wave-batch-1

Conversation

@ndii-dev

Copy link
Copy Markdown

Closes #293
Closes #296
Closes #299
Closes #300

Summary

#293 — recurring-date drift: lib/recurring.ts's buildNextRunAt added fixed 30-day ("monthly") and 90-day ("quarterly") offsets, causing renewal dates to drift across months of varying length (especially around February). Rewrote it to add real calendar months/quarters via Date.setMonth(), clamping to the last day of the target month when the original day doesn't exist there (e.g. Jan 31 + 1 month → Feb 28/29, not Mar 3). Weekly cadence is unchanged (7 real days is correct as-is).

#296 — lib/ unit test coverage: Added tests for two previously-untested lib/ utilities named in the coverage audit: __tests__/lib/recurring.test.ts (calendar-month/quarter edge cases tied to the #293 fix, rule persistence, upcoming-renewal filtering/sorting) and __tests__/lib/address-book.test.ts (add/update/delete/touch CRUD behavior, dedup-by-address, 50-entry cap, malformed-storage handling). Note: lib/csv-parser.ts, lib/error-messages.ts, and lib/receipt-utils.ts — the issue's stated top priority — already have thorough test suites in __tests__/lib/ from an earlier PR, so no duplicate tests were added there.

#299 — settings/analytics e2e coverage: Added e2e/settings.spec.ts (wallet gate, "Show USD values" toggle + persistence across reload, webhook register/validate/toggle/remove + persistence) and e2e/analytics.spec.ts (page structure and empty-state copy when unauthenticated; chart rendering against the app's built-in mock-data store when a wallet is connected, including exact stream counts for the default 30-day range vs. "All time", and token/section rendering).

#300 — accessibility.spec.ts scan coverage: The spec already contains @axe-core/playwright scans for dashboard/create-stream/stream-detail plus focus-trap and keyboard-navigation tests for the cancel-stream, tx-preview, and fee-estimate dialogs (this exceeds what the issue describes, which appears to predate an earlier expansion). Added axe scans for the two new pages introduced by this PR (settings, analytics) so they get the same automated a11y coverage from day one.

Test plan

  • npm run test (vitest) — new specs in __tests__/lib/recurring.test.ts and __tests__/lib/address-book.test.ts
  • npx playwright test e2e/settings.spec.ts e2e/analytics.spec.ts e2e/accessibility.spec.ts (mock mode, NEXT_PUBLIC_STREAM_CONTRACT_ID_TESTNET='')

🤖 Generated with Claude Code

https://claude.ai/code/session_01GTXYLUrw8kW1yWzcpDq8Cn

…, FlowwStar#296, FlowwStar#299, FlowwStar#300)

- lib/recurring.ts: buildNextRunAt now adds real calendar months/quarters
  (with end-of-month clamping) instead of fixed 30/90-day offsets, fixing
  renewal-date drift around February and 31-day months. (FlowwStar#293)

- Add unit tests for previously-untested lib/ utilities named in the
  coverage audit: __tests__/lib/recurring.test.ts (calendar-month edge
  cases, persistence, upcoming-renewal sorting) and
  __tests__/lib/address-book.test.ts (CRUD + touch/persist behavior).
  lib/csv-parser.ts, lib/error-messages.ts, and lib/receipt-utils.ts
  already have comprehensive tests in __tests__/lib/. (FlowwStar#296)

- Add e2e/settings.spec.ts (display-preference persistence, webhook
  register/toggle/remove/validate, persistence across reload) and
  e2e/analytics.spec.ts (chart rendering against the app's built-in mock
  data store, range-filter behavior, empty-state copy). (FlowwStar#299)

- Expand e2e/accessibility.spec.ts with axe scans for the new
  settings/analytics pages, complementing the existing automated a11y
  scans and focus-trap/keyboard-nav coverage for dashboard, create-stream,
  and the cancel-stream / tx-preview / fee dialogs. (FlowwStar#300)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTXYLUrw8kW1yWzcpDq8Cn
@Genghis-codes

Copy link
Copy Markdown

Superseded by #326, opened from the correct account.

1 similar comment
@ndii-dev

Copy link
Copy Markdown
Author

Superseded by #326, opened from the correct account.

@ndii-dev ndii-dev closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants