Repository navigation
[scheduler] Add regression tests for standalone month names in headers - #22841
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
|
Thanks a lot for the contribution! 🙌 The change itself is correct — the standalone-vs-formatting month distinction and the scheduler call-site changes are exactly right. One thing about where it should live: our scheduler adapter ( So Would you like to open that Base UI PR yourself? Happy to review it there — otherwise I can take care of it, no problem. |
Sure 😊 |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
Thanks again for taking care of the Base UI side! mui/base-ui#5164 is merged now 🎉 Quick update on where things stand here: since this PR was opened we dropped the manual
I'll ping here once the bump lands so we can rebase and get this merged. Thanks a lot for your contribution! 🙌 |
|
This pull request has been inactive for 30 days. Please remove the stale label or leave a comment to keep it open. Otherwise, it will be closed in 15 days. |
flaviendelangle
left a comment
There was a problem hiding this comment.
PR review
No merge-blocking issues found; one redundant test is worth removing. Verified head 46dbf99a9da107287935da773e6489e0b9d7cbb3. Targeted jsdom tests passed: 28 passed, with one browser-only test skipped.
Bugs (0)
No findings.
Tests (1)
1. 🟡 Remove the redundant adapter composition test
Location: packages/x-scheduler-internals/src/use-adapter/useAdapter.test.ts:57
expect(
adapterPl.formatByString(june, `${f.monthFullLetterStandalone} ${f.yearPadded}`),
).to.equal(adapterPl.formatByString(june, `LLLL ${f.yearPadded}`));This case constructs both patterns inside the test and compares equivalent calls to the same formatter. The preceding table already verifies the token mappings, while the new date-utils tests exercise production pattern selection. This case adds no independent regression coverage.
Failure scenario: These assertions still pass with the pre-fix scheduler helper returning czerwca 2026, as verified locally, because they never call that helper.
Fix: Remove this case and retain the adapter mapping, production helper, and calendar integration tests.
Simplifications (0)
No findings.
Docs (0)
No findings.
Verdict
Approve after nits - only redundant test coverage needs cleanup.
🤖 Review generated with Codex
|
@adamowski10 good news: the Base UI bump landed in #23855, so Could you rebase on
If you don't have time for it, just let us know and we can take care of the rebase ourselves, no problem at all. Thanks for your patience on this one! 🙌 |
46dbf99 to
a9bb7a3
Compare
Rebased on master and applied all the changes, including SidePanelDrawer. Thanks! |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
@rita-codes I rebased on master, and it turns out #24021 already fixed the bug. The headers now format the month and year with I could reduce this PR to two regression tests:
Would you like me to push that, or should I just close the PR? Either is fine with me 🙂 |
|
@adamowski10 you're right, nice catch! We've been making some big changes around the adapter lately and your PR got caught in the middle. The upside is that this is exactly the kind of locale bug the new approach makes much harder to introduce, so it's great to see it disappear on its own. The regression tests are still very welcome though: Thanks for sticking with this one! 🙌 |
Locales such as Polish and Czech inflect the month name when it follows a
day ("13 czerwca") but use the nominative form on its own ("czerwiec 2026").
The headers now format the month and the year with Intl, which picks the
standalone form, so these tests guard against regressing to the genitive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a9bb7a3 to
4afd03c
Compare
|
@rita-codes Pushed, and updated the title and description. Thanks! 👏 |
Context
In locales with grammatical month forms (Polish, Czech, Russian, Finnish, etc.), the calendar headers used to show the genitive month name, e.g. "czerwca 2026" instead of "czerwiec 2026" in Polish.
This was fixed by #24021: the headers now format the month and the year with
Intl({ month: 'long', year: 'numeric' }), which picks the standalone form on its own, while day-with-month formats such as "1 czerwca" keep the genitive.This PR started as a fix for that bug. After #24021, only the regression tests remain, so nothing guards the standalone-vs-genitive distinction otherwise.
Changes
date-locale.test.ts:formatMonthAndYearreturns "lipiec 2025" forpl-PLand "červenec 2025" forcs-CZEventCalendar.test.tsx: the header shows "czerwiec 2026" whendateLocale="pl-PL"Test plan
pnpm test:unit --project "x-scheduler*" --runpnpm eslintpnpm prettier