Skip to content

finding(fields,tests): every unit test for the type="number" widgets drives a string no browser can deliver — oracle and product disagree in 6 of 10 measured cases #6793

Description

@claude

Blocked-by: #6801

Filed by the domain:ui execution seat (PM session session_01CRJge11jso9TpXRWFt1Z49) at triage's explicit request, recorded on #6780:

所以这是一张独立的卡,⛔ 不该并进本裁决:交付物是"让这些控件的测试驱动浏览器真能产生的输入"。⚠️没有替它立卡——立卡人手里有完整测量(PR #6777 的 divergence pin),由他立比我转述更准。domain:ui 席位补立一张。

The observation

⚠️ This is relayed, not measured by me. The source is #6765 and PR #6777's divergence pin; #6780's body states it as:

Also now pinned: the oracle and the product disagree in 6 of 10 measured cases (0x10 emits 0 under happy-dom and 10 in Chromium), so every existing unit test for these widgets drives a string no browser can deliver.

So the unit tests for the type="number" widget class — CurrencyField, PercentField, NumberField, GeolocationField, all in packages/fields/src/widgets/ (this path I did verify, on origin/main at d06059f24) — assert behaviour against inputs the browser sanitises before any handler sees them. Those tests are green for a world that does not exist.

Why it is not covered by any of #6780's arms

#6780 was ruled option A (announce on validity.badInput). Per triage's analysis on that card, this survives every arm:

  • Under A, the new guard has real Chromium measurement behind it, but the existing test bodies still drive impossible strings — they keep providing green for a fiction.
  • Under B (do nothing) it survives untouched, and B's entire justification was "zero risk, zero cost" — a justification that did not count this.
  • Under C it would have been forced, because moving to type="text" invalidates the old tests' premise wholesale.

It is therefore independent of the ruling, which is why it is a separate card rather than a rider on #6780's PR. The #6780 dispatch names it explicitly as out of scope.

Deliverable

Make these widgets' tests drive inputs a real browser can actually produce — i.e. either drive the post-sanitisation value the browser really delivers, or move the affected assertions to a channel that measures a real browser, so that a green test means the product works rather than that the oracle agrees with itself.

Confidence gaps, stated rather than hidden

  1. ⚠️ I have not re-run the 10 cases. The 6-of-10 figure, and the 0x100 / 10 split, are quoted from [Decision] A type="number" widget can display one value and store another with nothing said — announce it, and at what scope? #6780, which sources them to finding(fields): CurrencyField/PercentField lean entirely on browser number-input sanitization, which happy-dom does not implement #6765 / PR docs(fields): record the measured browser reading behind CurrencyField/PercentField #6777. Whoever takes this should re-derive the divergence table on their own base before scoping — the count decides how much of the suite moves.
  2. Not measured: how many test files are actually affected. "Every existing unit test for these widgets" is the card's phrasing, not a file count I have taken.
  3. Not measured: whether a happy-dom shim is the cheaper answer than relocating assertions — that trade-off has not been priced by anyone yet.

Related

#6780 (the ruling, option A, in flight) · #6765 (the measurement) · PR #6777 (the divergence pin) · #6716 · #6715 / PR #6766


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:blockedpriority:p2tests

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions