Skip to content

fix: keep history tests aligned with paginated dates#4

Merged
donovan-yohan merged 3 commits into
mainfrom
fix/history-entry-visible-date
May 9, 2026
Merged

fix: keep history tests aligned with paginated dates#4
donovan-yohan merged 3 commits into
mainfrom
fix/history-entry-visible-date

Conversation

@donovan-yohan
Copy link
Copy Markdown
Owner

Summary

  • updates history-entry tests to render the page containing the gameplay fixture date instead of assuming it is always on page 1
  • includes the generated 2026-05-09 daily puzzle that the failing scheduled job was trying to add

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-02 on the wrong page.

The Case Against

  • The test duplicates the app's history page size (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.
  • Including the generated puzzle in this PR mixes a CI test fix with the artifact the failed scheduled job would have committed. This is intentional to recover today's missed artifact, but it makes the PR slightly less surgical.

Verification

  • DATE_INPUT="catch-up"; npm run add:daily-puzzle -- --date="${DATE_INPUT}" && npm run generate:daily-words
  • npm run check:daily-words
  • npm test
  • npm run build
  • PATH="$PWD/node_modules/.bin:$PATH" npm run lint

Note: bare local npm run lint on this machine picked up an old Bun-global ESLint 9.2 shim and failed before reading the repo config; forcing local node_modules/.bin used the repo ESLint and passed. CI should use the local dependency normally.

Copilot AI review requested due to automatic review settings May 9, 2026 13:32
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quartiles Ready Ready Preview, Comment May 9, 2026 1:42pm

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/App.test.tsx Outdated

const latestDailyDate = LATEST_DAILY_DATE
const gameplayDailyDate = '2026-05-02'
const testHistoryPageSize = 7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This constant duplicates the historyPageSize value from App.tsx. To improve maintainability and ensure that tests automatically adapt to changes in the production pagination logic, consider exporting historyPageSize from App.tsx and importing it here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tsx to 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.ts to 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.

Comment thread src/App.test.tsx Outdated

const latestDailyDate = LATEST_DAILY_DATE
const gameplayDailyDate = '2026-05-02'
const testHistoryPageSize = 7
@donovan-yohan
Copy link
Copy Markdown
Owner Author

Addressed bot feedback about duplicated pagination size:

  • exported historyPageSize from src/App.tsx
  • imported that shared value in src/App.test.tsx instead of keeping a duplicate testHistoryPageSize

Verification:

  • npm test -- --run src/App.test.tsx -t "shows cookie-backed progress|persists each hinted"
  • npm run check:daily-words
  • npm test
  • npm run build
  • PATH="$PWD/node_modules/.bin:$PATH" npm run lint

PR checks are green after the follow-up commit.

@donovan-yohan donovan-yohan merged commit ef8a428 into main May 9, 2026
3 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