Repository navigation
test: Add visual coverage for Input focus states - #5127
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5127 +/- ##
=======================================
Coverage 97.71% 97.71%
=======================================
Files 991 991
Lines 31840 31840
Branches 11759 11759
=======================================
Hits 31112 31112
Misses 682 682
Partials 46 46 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
/override-visual-regression New page input/focus-states has no baseline on main; the nine new entries fail with ".screenshot-area is not visible" on the baseline. |
pan-kot
approved these changes
Oct 9, 2026
This branch was successfully deployed
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.
Description
Adds visual-regression coverage for four Input rendering states ahead of a refactor of how Input paints its field. Each state is captured as its own named test, so the refactor PR's visual report shows readable per-state items instead of anonymous pixel diffs. On
mainthe new screenshots are identical between baseline and PR builds, so this PR itself produces zero visual diff.New dev page
pages/input/focus-states.page.tsx(#/light/input/focus-states) renders one captioned section per state, each Input tagged with adata-testid:readonly:<Input readOnly value="Read-only value" />native-invalid:<Input type="email" value="not-an-email" />(browser:invalid, noinvalidprop)suffix:<Input value="42" suffix="USD" />prefix:<Input value="42" prefix="$" />test/definitions/visual/input.tsgains ninescreenshotAreaentries on that page:rest, and for each inputfocused <id>andfocused <id>, pointer away. Focus is produced withpage.click(): the component's focus styles are plain CSS:focus/:focus-within, which the existingpage.focusInputs()helper (a dispatchedfocusinevent) does not trigger. The pointer-away variants move the mouse to the page heading after clicking, because one of the states under test only shows once the pointer leaves the field.Related links, issue #, if available: n/a
How has this been tested?
npm run quick-build;TZ=UTC npx jest -c jest.unit.config.js src/input: 143 tests pass, no snapshot changes.tsc --noEmit -p tsconfig.test-definitions.json, eslint and prettier pass on the two changed files.setupreproduced in Chrome (puppeteer-core) on a dev server: clicking focuses the targeted input and the focus persists after the pointer moves to the heading; the page renders in light and dark..screenshot-area, pixelmatch) against the same page onmainand on the upcoming refactor branch: zero diff between twomainbuilds; on the refactor branch thereadonlyandnative-invalidfocused entries and thesuffix/prefixpointer-away entries differ, as intended.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.