Repository navigation
test(fields): cover PhoneField in the standard-widget suite, point DateField and TextAreaField to theirs - #7571
Merged
os-project-manager merged 2 commits intoSep 4, 2026
Conversation
… the rest `standard-widgets.test.tsx` exercised 7 of the 10 standard widgets it once imported. PR #7332 removed the three unused imports -- correct, an unused import asserts nothing -- but that left the file reading as a complete sweep of the set with no signal that members were missing. Measured per widget rather than filling the file to 10/10: - `PhoneField` -- the real gap. It renders in exactly one test file (`__tests__/validation-feedback.test.tsx`) and only inside the cross-widget contract battery (aria-invalid, disabled, empty-readonly dash, default placeholder). Nothing anywhere asserted the `tel` input type or the `tel:` link its readonly branch renders. Adds that readonly/edit round trip in the shape the EmailField and UrlField blocks already use. - `DateField` -- covered by a sibling file: `datetime-widgets.test.tsx` holds a full `describe('DateField')` (edit input, onChange, locale-formatted readonly, empty dash, plus the #3127 stored-ISO round trip). A case here would duplicate it, so it gets a pointer. - `TextAreaField` -- seven dedicated suites in `widgets/__tests__/`. Pointer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
The pointer comment claimed `describe('DateField')` in
`datetime-widgets.test.tsx` holds the objectui#3127 stored-ISO round trip. It
does not. Brace-matched against the tree: `describe('DateField')` spans lines
23-48 and holds exactly four cases (edit-mode input, onChange,
locale-formatted readonly, empty-value dash). The `DateField` round trip is at
line 153, inside the sibling `describe('existing values round-trip through the
native controls (#3127)')` at lines 88-164, which it shares with three
`DateTimeField` cases.
The file does hold the case, so the pointer sent a reader to the right file --
but it named the wrong block. This card exists because a suite asserted a
shape it did not have; the repair should not reproduce that in miniature.
Comment text only. No assertion changes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-project-manager
marked this pull request as ready for review
September 3, 2026 23:54
os-project-manager
deleted the
claude/issue-7336-standard-widgets-coverage
branch
September 4, 2026 00:10
This was referenced Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7336
Clause-②: no
Determined from this diff, not assumed: it is two files —
packages/fields/src/standard-widgets.test.tsxand one changeset. It moves no declaration, adds no export, and touches nothing outside this package's own test suite.Summary — one widget got cases, two got pointers
The card asks whether
standard-widgets.test.tsxhides a gap by covering 7 of the 10 standard widgets it once imported. It does. But the honest repair is not three cases, and it is not the two-cases-and-a-comment the triage ruling projected either. Measured per widget:PhoneFieldDateFieldTextAreaFieldThe measurement, and where it departs from triage
Triage read one column: dedicated suites in
packages/fields/src/widgets/__tests__/. That directory-scoped instrument was lit (TextAreaFieldscores 7 in it), but its domain does not contain the coverage —CurrencyField, the calibration control the card itself names, also scores 0 in that same directory while being covered in two other places. So I widened the instrument to "which test files anywhere actually render the widget", pathspec-filtered:(
[OPEN-TAG]stands in for the JSX open-angle-bracket, which GitHub's body sanitizer eats.)Per-widget counts on that instrument, with the controls printed in the same pass:
TextAreaFieldCurrencyField(control)DateFieldEmailField(control)UrlField(control)PhoneFieldDateFieldis not the gap.packages/fields/src/datetime-widgets.test.tsx— the file directly next to this one — already covers it. Brace-matched against the tree rather than eyeballed: itsdescribe('DateField')spans lines 23-48 and holds exactly four cases — edit-mode input, onChange, locale-formatted readonly, empty-value dash. The objectui#3127 stored-ISO round trip forDateFieldis at line 153 in that same file but a sibling block,describe('existing values round-trip through the native controls (#3127)')at lines 88-164, which it shares with threeDateTimeFieldcases. The locale channel is pinned separately in__tests__/date-locale-channel.test.tsx(objectui#4468) and thetoDateInputValuehelper inwidgets/nativeDateValue.test.ts. Writing the readonly/edit round trip here would have duplicated it almost line for line — precisely the trap triage flagged, just attached to a different widget than expected.PhoneFieldis the gap. It renders in exactly one test file,__tests__/validation-feedback.test.tsx, and all four of its cases there belong to a cross-widget contract battery: aria-invalid, disabled, empty-readonly dash, default placeholder. Nothing in that file — or anywhere else — asserted the two things that make it a phone widget: thetelinput type, and thetel:link its readonly branch renders. Thetel:assertions that do exist in the repo belong to the plugin-list and plugin-report cell renderers, not to this widget.So
PhoneFieldgets the readonly/edit round trip, in the shape theEmailFieldandUrlFieldblocks above it already use. No new shape invented.Verification
Exit codes were captured by redirect-then-read, never through a pipe; the verdict lines below are the gates' own output.
Test counts, before and after (repo root, as the objectui#3378 guard requires):
standard-widgets.test.tsxbeforestandard-widgets.test.tsxafterpackages/fields/afterThe package-level before (132 / 2150) is derived, not directly measured: only one test file changed, and its own before/after was measured directly.
Both new cases were shown to discriminate. The fact was mutated in
PhoneField.tsx— not the assertion — each mutation proven on disk by anchored fixed-string counts plusgit hash-object, and each restore proven by state (git diff HEADempty AND worktree blob equal to the HEAD blob), undertrap ... EXIT INT TERMwith absolute paths, restoring viagit checkout HEAD -- [abs path]:type="tel"becomestype="text"Tests 1 failed | 25 passed (26)— onlyshould render tel inputtel:template href becomes the bare valueTests 1 failed | 25 passed (26)— onlyshould render clickable tel link in readonly modeEach mutation kills exactly one case and only the intended one. Worth recording: mutation B's first attempt used an invalid regex for its anchored count, so the count came back empty — the script treated the void reading as a failure and aborted rather than reporting it, and the trap restored the tree. It was re-run with a fixed-string count.
Gates, quoting their own verdict lines:
check-changeset-presence.mjs— first run exit 1, naming this file as published source of a released package. Its own text calls the empty-frontmatter declaration "the explicit exemption and a complete answer to this gate", which is what a test-only diff is; after adding it:Every one of them has an EMPTY frontmatter — declared as releasing nothing.check-changeset-no-major.mjs—No changeset declares a major bump.tsc -p packages/fields/tsconfig.json --noEmit— exit 0, 0 errors.tsc -p packages/fields/tsconfig.test.json --noEmit— exit 0, 0 errors. This one initially exited 2 withTS2307 Cannot find moduleacross many files: a precondition, not a failure. After building the dependency closure it is clean. Confirmed by--listFilesthat the edited file is genuinely in the program (1 hit) rather than excluded — atypecheckthat excludes test files would have been a true statement about nothing.eslintonpackages/fields— 214 files, 0 errors, 913 warnings, none new in kind: the file'sas anycount goes 24 to 26, exactly the two added cases in the idiom every case in the file already uses.Narrowings, declared:
packages/fields(214 files by eslint's own enumeration) rather than the whole repo. It could have caught a lint violation in a file this diff edits — and the one file this diff edits is inside those 214. The repo'seslint.config.jssets noprojectServiceorparserOptions.project, so linting is not type-aware and no untouched file's verdict can move on account of this diff.packages/fields/rather than the full repo suite. It could have caught a suite that consumes the changed file;git grepfinds zero references tostandard-widgetsoutside the file itself, with a lit control in the same pass (widgets/PhoneFieldreturns 4+ referencing files, so the instrument works).Out of scope, filed not fixed
#7570 —
openNativePickerhas zero test coverage anywhere in the repo, withtoDateInputValuelit as the control on the same instrument.DateFieldis its sole router and no existing case fires a click. Recorded, unassigned; deliberately not fixed here, since this card isp3and scoped to one file's documentation-of-absence.Correction, pushed as a second commit
The pointer comment's first wording said
describe('DateField')held the objectui#3127 round trip. It does not — the block holds four cases and the round trip sits in the sibling block named above. The file is still the right destination, but the comment named the wrong block inside it, and this card exists precisely because a suite asserted a shape it did not have.b7f1b545dcorrects the comment text; no assertion changed, and the diff is still the same two files.Re-verified on the new head
b7f1b545d:standard-widgets.test.tsx1 file / 26 tests passed,check-changeset-presence.mjsgreen (declares 1 changeset(s)), eslint on the file 0 errors / 26 warnings (unchanged), control-byte scan clean. The mutation battery was deliberately not re-run: the assertions are byte-identical, only comment prose moved.🤖 Generated with Claude Code
https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC