Use resultUpdatedAt to derive current day and add day-14 championship test#85
Use resultUpdatedAt to derive current day and add day-14 championship test#85dai wants to merge 1 commit into
Conversation
Deploying o-sumo with
|
| Latest commit: |
9998340
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dfe6612a.o-sumo.pages.dev |
| Branch Preview URL: | https://codex-fix-changes-not-reflec-h150.o-sumo.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9998340943
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| </MemoryRouter>, | ||
| ); | ||
|
|
||
| expect(screen.getByRole('heading', { level: 2, name: '優勝争い(14日目)' })).toBeInTheDocument(); |
There was a problem hiding this comment.
Make championship test compute expected day from fixture
This assertion hard-codes 14日目, so the test will fail as soon as MAY2026_TORIKUMI_DATA.resultUpdatedAt advances to day 15 even if Home is behaving correctly. Because this dataset is updated over time, the test is time-sensitive and can break CI for a valid UI change; deriving the expected day from fixture data (or freezing a dedicated test fixture) would keep the test stable.
Useful? React with 👍 / 👎.
Motivation
Description
referenceDatefromMAY2026_TORIKUMI_DATA.resultUpdatedAt?.slice(0, 10)and derivelatestKnownDayby filteringresultDayswithisoDate <= referenceDateand taking the maxday.currentDaytoMath.max(latestPublishedResultDay, latestKnownDay)so the UI reflects the latest known day even if not published.shows championship header as day 14 when day 14 has startedinapp/page.test.tsxwhich rendersHomeand asserts the championship headings are present.app/page.tsxandapp/page.test.tsx.Testing
shows championship header as day 14 when day 14 has startedexecuted successfully.app/page.test.tsxassertions continued to pass after the change.Codex Task