Fix recurring-date drift, add missing lib/e2e/a11y test coverage - #325
Closed
ndii-dev wants to merge 1 commit into
Closed
Fix recurring-date drift, add missing lib/e2e/a11y test coverage#325ndii-dev wants to merge 1 commit into
ndii-dev wants to merge 1 commit into
Conversation
…, 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
|
Superseded by #326, opened from the correct account. |
1 similar comment
Author
|
Superseded by #326, opened from the correct account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #293
Closes #296
Closes #299
Closes #300
Summary
#293 — recurring-date drift:
lib/recurring.ts'sbuildNextRunAtadded 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 viaDate.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, andlib/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) ande2e/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/playwrightscans 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.tsand__tests__/lib/address-book.test.tsnpx 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