Repository navigation
fix(web): drop zero-width spaces and soft hyphens from a name #2495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
gagarinyury
wants to merge
10
commits into
e2e-inc:main
from
gagarinyury:fix/web-name-invisible-characters
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8134f96
fix(web): drop zero-width spaces and soft hyphens from a name
gagarinyury 01b2ca2
fix(web): keep the title fallback for glyph-only names, and normalize…
gagarinyury 5f0d5f1
fix(web): normalize an iframe's title fallback as reportedName does
gagarinyury 50e5b9a
fix(web): say when a soft hyphen shows, and name the icon-glyph test
gagarinyury 1c9f318
fix(web): drop invisible breaks from the document name too
gagarinyury d04de85
fix(web): drop invisible breaks from the label and name a test passes
gagarinyury 7c55694
fix(web): match a copied name in getByRole, and keep the name drop we…
gagarinyury 1fd90fa
fix(web): drop only the invisible breaks from a title fallback, and t…
gagarinyury 3760419
docs(web): a zero-width space never shows, and the drop applies to a …
gagarinyury 0d11a28
docs(web): say toHaveAccessibleName compares the text as written
gagarinyury File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@e2e-dev/web': patch | ||
| --- | ||
|
|
||
| A name or label in the web tree drops zero-width spaces and soft hyphens, as Playwright's `getByRole` does. `<a href="https://example.com/privacy">Datenschutz­erklärung</a>` reads as `link "Datenschutzerklärung"`, so `toHaveAccessibleName('Datenschutzerklärung')` holds for the link `getByRole('link', { name: 'Datenschutzerklärung' })` finds; it used to fail on the hidden character. `getByRole` and an exact `getByLabel` drop them from the name a test passes too, so a name copied from the page, hidden soft hyphen and all, still finds the control. `toHaveAccessibleName` compares the text it is passed as written, so that text should omit them. |
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.