fix(web): match getByText across a line break as the text reads
Closed
PO
3d ago+87+87+01234567890123456789-2-2-0123456789
What and why
getByText('Line one line two')found nothing for<p>Line one<br>line two</p>, thoughtextContent()reads it that way. A string now also matches where a line break stands in for a space, the same way role names already tolerate icon glyphs.- Exact stays whole and case-sensitive; a RegExp is passed as written.
Issue
Fixes #2167
Verified
Ran it locally: yes
- New
tests/integration/text-line-breaks.test.tsfails on main and passes with this change. @e2e-dev/webtests pass (7 video and svg visibility failures are the same on main in my environment), plustsc --noEmit,oxlintand the changeset check.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only
Summary by CodeRabbit
- Bug Fixes
- Text searches now match multiword text across line breaks, including case-insensitive and normalized queries. Exact matches remain whole-text and case-sensitive.