fix: keep history tests aligned with paginated dates#4
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request adds a new daily puzzle for 2026-05-09 and updates the test suite to support history pagination through new helper functions. Feedback suggests exporting the pagination page size from the application logic to the tests to prevent duplication and improve maintainability.
|
|
||
| const latestDailyDate = LATEST_DAILY_DATE | ||
| const gameplayDailyDate = '2026-05-02' | ||
| const testHistoryPageSize = 7 |
There was a problem hiding this comment.
Pull request overview
This PR fixes brittle history-entry tests by navigating to the correct paginated history page for the fixture date, and it checks in the missing generated daily puzzle data for 2026-05-09 so CI/data generation are back in sync.
Changes:
- Update
App.test.tsxto compute which history page contains the fixture date and render that page (instead of assuming page 1). - Add the 2026-05-09 daily puzzle to
src/data/daily-puzzles.json. - Refresh
src/data/generated-daily-puzzles.tsto include the generated dictionary/metadata for the 2026-05-09 puzzle.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/App.test.tsx | Adds a helper to locate the correct history pagination page for the fixture date before asserting on history-entry-YYYY-MM-DD. |
| src/data/daily-puzzles.json | Adds the 2026-05-09 daily puzzle quartets to the source-of-truth input file. |
| src/data/generated-daily-puzzles.ts | Includes the newly generated 2026-05-09 daily puzzle entry (quartets + generated word list). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const latestDailyDate = LATEST_DAILY_DATE | ||
| const gameplayDailyDate = '2026-05-02' | ||
| const testHistoryPageSize = 7 |
|
Addressed bot feedback about duplicated pagination size:
Verification:
PR checks are green after the follow-up commit. |
Summary
Why
The daily generation job now catches up through the current date. Once 2026-05-09 was generated, the hardcoded 2026-05-02 test fixture moved from history page 1 to page 2, so two tests failed looking for
history-entry-2026-05-02on the wrong page.The Case Against
7) instead of importing it from production code because that constant is not exported. If the app page size changes, this test helper must change too.Verification
DATE_INPUT="catch-up"; npm run add:daily-puzzle -- --date="${DATE_INPUT}" && npm run generate:daily-wordsnpm run check:daily-wordsnpm testnpm run buildPATH="$PWD/node_modules/.bin:$PATH" npm run lintNote: bare local
npm run linton this machine picked up an old Bun-global ESLint 9.2 shim and failed before reading the repo config; forcing localnode_modules/.binused the repo ESLint and passed. CI should use the local dependency normally.