← Back to Pull requests

[lexical-playground] Chore: Pick a day that has a button in the date picker tests #10001

Merged
mayrang merged 1 files (29 lines) on Dec 01, 2026 14:24 UTC
View on GitHub
mayrang mayrang commented on Dec 01, 2026 07:49 UTC
Author

Description

pickOtherDay in the DateTimeComponent tests clicks the first day cell that is not selected. The picker opens on the current month and hides the days of the months around it (showOutsideDays={false}), which leaves their cells without a button; a month whose first day is not a Sunday starts with such cells. November 2026 starts on a Sunday, so the helper passed until December, when it found one of those cells and failed with expected a day to pick: 8 tests fail on any branch, as in the core-tests / unit jobs of #9999. The helper now picks a cell that is not selected and has a button, and the tests run on a pinned date (15 December 2026), so the month no longer depends on when CI runs.

Test plan

Before

$ TZ=UTC ./node_modules/.bin/vitest run --project unit packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx
     × (a) keeps a picked day all-day after checking the time box 119ms
     × (n) keeps a typed 00:00 when a day is picked 57ms
     × (p) keeps a timed chip at local midnight timed when a day is picked 46ms
     × (q) keeps a typed 00:00 when a day is picked after reopening 99ms
     × (d) keeps the stored time when the time field is empty 55ms
     × (e) gives a chip without a date an all-day date 61ms
     × (k) clears the time box and keeps the next day all-day 72ms
     × (l) treats a redo of its own earlier change as an outside change 44ms
AssertionError: expected a day to pick
      Tests  8 failed | 12 passed (20)

After

$ TZ=UTC ./node_modules/.bin/vitest run --project unit packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx
      Tests  20 passed (20)

The same with TZ=Asia/Seoul and TZ=America/Los_Angeles, run on 2026-12-01.

Diff: 29 lines (+26 / -3) across 1 files Reviewer: zurfyx Review duration: 395m
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.23) × (1 − Review Confidence (0.86)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.23 · 29 lines diff across 1 files
0.23
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.81 · 5 substantive comment(s)
0.81
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
86%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.203
Real PR Conversation Timeline
11 items
vercel[bot] vercel[bot] commented on Dec 01, 2026 07:49 UTC
Bot

[vc]: #5VYH8HUpZPhEuULbEU7DYZ3JJ9rmvHv08tGZHwaEEH8=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJsZXhpY2FsLXBsYXlncm91bmQiLCJwcm9qZWN0SWQiOiJwcmpfZWE4MnZMajY4NFh6U1JkZU83SlNkMFFOa2F3cyIsInYwIjpmYWxzZSwicm9vdERpcmVjdG9yeSI6InBhY2thZ2VzL2xleGljYWwtcGxheWdyb3VuZCIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9mYm9wZW5zb3VyY2UvbGV4aWNhbC1wbGF5Z3JvdW5kL3BRSzd2ZDVldU5XMXBYNE1HRmhOalc1TXhHU0IiLCJwcmV2aWV3VXJsIjoibGV4aWNhbC1wbGF5Z3JvdW5kLWdpdC1mb3JrLW1heXJhbmctZml4LWRhdC0yNDQ3OTQtZmJvcGVuc291cmNlLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQifSx7Im5hbWUiOiJsZXhpY2FsIiwicHJvamVjdElkIjoicHJqX01SYU1PMzFlRklrWTYxU0JxcVBEUjJPank4cVAiLCJ2MCI6ZmFsc2UsInJvb3REaXJlY3RvcnkiOiJwYWNrYWdlcy9sZXhpY2FsLXdlYnNpdGUiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vZmJvcGVuc291cmNlL2xleGljYWwvOHBjU2VWYTdtdmdqWWJKamU4aHNOb29GMVp6dCIsInByZXZpZXdVcmwiOiJsZXhpY2FsLWdpdC1mb3JrLW1heXJhbmctZml4LWRhdGV0aW1lLXRlc3QtNmZlMDk0LWZib3BlbnNvdXJjZS52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIn1dLCJyZXF1ZXN0UmV2aWV3VXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3ZlcmNlbC1hZ2VudC9yZXF1ZXN0LXJldmlldz9vd25lcj1tZXRhJnJlcG89bGV4aWNhbCZwcj0xMDAwMSJ9
The latest updates on your projects. Learn more about Vercel for GitHub.

| Project | Deployment | Actions | Updated |
| :--- | :----- | :------ | :------ |
| <a href="https://vercel.com/fbopensource/lexical"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_MRaMO31eFIkY61SBqqPDR2Ojy8qP&teamId=team_QNIQyH5DJlqUjeCckcCcBEjE&s=32" width="16" height="16" align="middle" alt="" /></sup></a> lexical | !Ready Ready | Preview | <relative-time datetime="2026-12-01T08:14:09.549Z">Dec 1, 2026 8:14am UTC</relative-time> |
| <a href="https://vercel.com/fbopensource/lexical-playground"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_ea82vLj684XzSRdeO7JSd0QNkaws&teamId=team_QNIQyH5DJlqUjeCckcCcBEjE&s=32" width="16" height="16" align="middle" alt="" /></sup></a> lexical-playground | !Ready Ready | Preview | <relative-time datetime="2026-12-01T08:14:09.549Z">Dec 1, 2026 8:14am UTC</relative-time> |

<a href="https://vercel.com/vercel-agent/request-review?owner=meta&repo=lexical&pr=10001" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>

rootnode-bot[bot] rootnode-bot[bot] commented on Dec 01, 2026 07:49 UTC
Bot

AI review status for this pull request.

| Review status | Updated |
| :--- | :--- |
| 🟢 Reviewed (for maintainers only) | <relative-time datetime="2026-12-01T08:22:44Z">Dec 1, 2026, 8:22 AM UTC</relative-time> |

<!-- codebunny-status:1 r=318341089 p=10001 rv=2 -->

pkg-pr-new[bot] pkg-pr-new[bot] commented on Dec 01, 2026 07:52 UTC
Bot

<details><summary><b>lexical</b></summary><p>

  npm i https://pkg.pr.new/lexical@10001
  


</p></details>

<details><summary><b>@lexical/a11y</b></summary><p>

  npm i https://pkg.pr.new/@lexical/a11y@10001
  


</p></details>

<details><summary><b>@lexical/clipboard</b></summary><p>

  npm i https://pkg.pr.new/@lexical/clipboard@10001
  


</p></details>

<details><summary><b>@lexical/code</b></summary><p>

  npm i https://pkg.pr.new/@lexical/code@10001
  


</p></details>

<details><summary><b>@lexical/code-core</b></summary><p>

  npm i https://pkg.pr.new/@lexical/code-core@10001
  


</p></details>

<details><summary><b>@lexical/code-prism</b></summary><p>

  npm i https://pkg.pr.new/@lexical/code-prism@10001
  


</p></details>

<details><summary><b>@lexical/code-shiki</b></summary><p>

  npm i https://pkg.pr.new/@lexical/code-shiki@10001
  


</p></details>

<details><summary><b>@lexical/compiler</b></summary><p>

  npm i https://pkg.pr.new/@lexical/compiler@10001
  


</p></details>

<details><summary><b>@lexical/devtools-core</b></summary><p>

  npm i https://pkg.pr.new/@lexical/devtools-core@10001
  


</p></details>

<details><summary><b>@lexical/dragon</b></summary><p>

  npm i https://pkg.pr.new/@lexical/dragon@10001
  


</p></details>

<details><summary><b>@lexical/eslint-plugin</b></summary><p>

  npm i https://pkg.pr.new/@lexical/eslint-plugin@10001
  


</p></details>

<details><summary><b>@lexical/extension</b></summary><p>

  npm i https://pkg.pr.new/@lexical/extension@10001
  


</p></details>

<details><summary><b>@lexical/fast-check</b></summary><p>

  npm i https://pkg.pr.new/@lexical/fast-check@10001
  


</p></details>

<details><summary><b>@lexical/file</b></summary><p>

  npm i https://pkg.pr.new/@lexical/file@10001
  


</p></details>

<details><summary><b>@lexical/hashtag</b></summary><p>

  npm i https://pkg.pr.new/@lexical/hashtag@10001
  


</p></details>

<details><summary><b>@lexical/headless</b></summary><p>

  npm i https://pkg.pr.new/@lexical/headless@10001
  


</p></details>

<details><summary><b>@lexical/history</b></summary><p>

  npm i https://pkg.pr.new/@lexical/history@10001
  


</p></details>

<details><summary><b>@lexical/html</b></summary><p>

  npm i https://pkg.pr.new/@lexical/html@10001
  


</p></details>

<details><summary><b>@lexical/internal</b></summary><p>

  npm i https://pkg.pr.new/@lexical/internal@10001
  


</p></details>

<details><summary><b>@lexical/link</b></summary><p>

  npm i https://pkg.pr.new/@lexical/link@10001
  


</p></details>

<details><summary><b>@lexical/list</b></summary><p>

  npm i https://pkg.pr.new/@lexical/list@10001
  


</p></details>

<details><summary><b>@lexical/mark</b></summary><p>

  npm i https://pkg.pr.new/@lexical/mark@10001
  


</p></details>

<details><summary><b>@lexical/markdown</b></summary><p>

  npm i https://pkg.pr.new/@lexical/markdown@10001
  


</p></details>

<details><summary><b>@lexical/mdast</b></summary><p>

  npm i https://pkg.pr.new/@lexical/mdast@10001
  


</p></details>

<details><summary><b>@lexical/offset</b></summary><p>

  npm i https://pkg.pr.new/@lexical/offset@10001
  


</p></details>

<details><summary><b>@lexical/overflow</b></summary><p>

  npm i https://pkg.pr.new/@lexical/overflow@10001
  


</p></details>

<details><summary><b>@lexical/plain-text</b></summary><p>

  npm i https://pkg.pr.new/@lexical/plain-text@10001
  


</p></details>

<details><summary><b>@lexical/react</b></summary><p>

  npm i https://pkg.pr.new/@lexical/react@10001
  


</p></details>

<details><summary><b>@lexical/rich-text</b></summary><p>

  npm i https://pkg.pr.new/@lexical/rich-text@10001
  


</p></details>

<details><summary><b>@lexical/selection</b></summary><p>

  npm i https://pkg.pr.new/@lexical/selection@10001
  


</p></details>

<details><summary><b>@lexical/table</b></summary><p>

  npm i https://pkg.pr.new/@lexical/table@10001
  


</p></details>

<details><summary><b>@lexical/tailwind</b></summary><p>

  npm i https://pkg.pr.new/@lexical/tailwind@10001
  


</p></details>

<details><summary><b>@lexical/text</b></summary><p>

  npm i https://pkg.pr.new/@lexical/text@10001
  


</p></details>

<details><summary><b>@lexical/utils</b></summary><p>

  npm i https://pkg.pr.new/@lexical/utils@10001
  


</p></details>

<details><summary><b>@lexical/y</b></summary><p>

  npm i https://pkg.pr.new/@lexical/y@10001
  


</p></details>

<details><summary><b>@lexical/yjs</b></summary><p>

  npm i https://pkg.pr.new/@lexical/yjs@10001
  


</p></details>

_commit: <a href="https://github.com/meta/lexical/runs/142495967568"><code>f271a97</code></a>_

rootnode-bot[bot] rootnode-bot[bot] commented on code on Dec 01, 2026 08:06 UTC
Code Review
packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx:1
@@ -137,11 +137,17 @@ async function typeTime(time: string): Promise<void> {
   });
 }
 
-// Clicks a day other than the selected one and returns it as YYYY-MM-DD
+// Clicks a day other than the selected one and returns it as YYYY-MM-DD.
+// The days of the months around it have no button, and on the first days of
+// a month the calendar starts with some.

Nit (optional): the button-less days are not limited to the first days of a month. The picker opens on the current month, and its grid starts with hidden cells all month whenever the 1st is not a Sunday (11 of the 12 months of 2027), which is why the old helper failed every day of December. Maybe: "The picker opens on the current month and hides the days of the months around it, which have no button; most months start with some."

rootnode-bot[bot] rootnode-bot[bot] commented on code on Dec 01, 2026 08:06 UTC
Code Review
packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx:1
@@ -137,11 +137,17 @@ async function typeTime(time: string): Promise<void> {
   });
 }
 
-// Clicks a day other than the selected one and returns it as YYYY-MM-DD
+// Clicks a day other than the selected one and returns it as YYYY-MM-DD.
+// The days of the months around it have no button, and on the first days of
+// a month the calendar starts with some.
 async function pickOtherDay(): Promise<string> {

Optional, non-blocking: these tests still read the real date, so the day clicked is the 1st of whatever month CI runs in while every chip is dated November 2026. Pinning the date in a beforeEach (for example vi.useFakeTimers({toFake: ['Date']}) with vi.setSystemTime(new Date(2026, 10, 15)), and vi.useRealTimers() afterwards) would make the grid and the picked day the same on every run.

rootnode-bot[bot] rootnode-bot[bot] approved these changes on Dec 01, 2026 08:06 UTC
Approved Reviewer

Thanks for tracking this down — the change looks good. The picker opens on the current month with showOutsideDays={false}, so in December 2026 the grid starts with two hidden cells (29 and 30 November) that carry data-day but no button, and the old find stopped on the first of them. Requiring a button in pickOtherDay fixes that without weakening any assertion: every test still checks the value for the day it clicked.

Two optional, non-blocking suggestions:

1. Pin the clock (packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx:143). The tests still read the real date, so the day clicked is the 1st of whatever month CI runs in, while every chip is dated November 2026. Setting the date in a beforeEach, for example vi.useFakeTimers({toFake: ['Date']}) with vi.setSystemTime(new Date(2026, 10, 15)) and vi.useRealTimers() afterwards, would make the grid and the picked day the same on every run.
2. Comment wording (DateTimeComponent.test.tsx:141-142). The button-less days are not limited to the first days of a month: they are there all month whenever the 1st is not a Sunday (11 of the 12 months of 2027), which is why the old helper failed every day of December. Something like: "The picker opens on the current month and hides the days of the months around it, which have no button; most months start with some."

No changeset is needed: AGENTS.md says tests and the playground need none.

Automated review (maintainer link)

<!-- codebunny-pub:1 k=f9670035485410e129843a2c0f0d90972f550d62943997962b4f988b298a5f55 -->

mayrang mayrang commented on code on Dec 01, 2026 08:12 UTC
Code Review
packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx:1
@@ -137,11 +137,17 @@ async function typeTime(time: string): Promise<void> {
   });
 }
 
-// Clicks a day other than the selected one and returns it as YYYY-MM-DD
+// Clicks a day other than the selected one and returns it as YYYY-MM-DD.
+// The days of the months around it have no button, and on the first days of
+// a month the calendar starts with some.

Reworded in f271a979d: the hidden days are there whenever the 1st is not a Sunday.

mayrang mayrang commented on code on Dec 01, 2026 08:12 UTC
Code Review
packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx:1
@@ -137,11 +137,17 @@ async function typeTime(time: string): Promise<void> {
   });
 }
 
-// Clicks a day other than the selected one and returns it as YYYY-MM-DD
+// Clicks a day other than the selected one and returns it as YYYY-MM-DD.
+// The days of the months around it have no button, and on the first days of
+// a month the calendar starts with some.
 async function pickOtherDay(): Promise<string> {

Pinned in f271a979d to 15 December 2026, so the grid still starts with hidden days and the button check stays covered.

rootnode-bot[bot] rootnode-bot[bot] approved these changes on Dec 01, 2026 08:22 UTC
Approved Reviewer

Thanks for the quick follow-up, the change looks good. Both earlier suggestions are in: the clock is pinned to 15 December 2026 (packages/lexical-playground/__tests__/unit/DateTimeComponent.test.tsx:93-96), so the picker, which opens on today's month, always shows a grid that starts with hidden days, and the helper comment now says those days appear whenever the 1st is not a Sunday. With showOutsideDays={false} those cells carry data-day but no button; requiring a button in pickOtherDay (:163-167) skips them without weakening any assertion, since every test still checks the value for the day it clicked. That is the failure CI's core-tests / unit (24.x) hit on #9999 today, at the old helper's assert.

One optional, non-blocking nit:

  • Assert the pinned day (DateTimeComponent.test.tsx:91-92). Nothing checks that the pin reaches the picker: if it ever stopped doing so, the tests would pick the 1st of the real month and still pass, and the comment would quietly be wrong. An expect(day).toBe('2026-12-01') after pickOtherDay() in test (a) would keep it honest.
  • No changeset is needed: AGENTS.md and CONTRIBUTING.md say test and playground changes need none.

    Automated review (maintainer link)

    <!-- codebunny-pub:1 k=340cd80c30602fa47623f8147a71217e436719a437c11fb0dcf70c55bd4ce7ae -->

    zurfyx zurfyx approved these changes on Dec 01, 2026 13:53 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    mayrang mayrang
    Labels
    risk: low confidence: 86.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 23.3% (LOW) · Higher = larger blast radius
    23.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 86.5% · Lower = rushed or shallow review
    86.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3.2% · Safe to merge
    3.2%
    Repository