Skip to content
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

Normalize whitespace in getAccessibilityTree #345

Merged
merged 9 commits into from
Mar 31, 2022

Conversation

calebeby
Copy link
Member

Now anytime there is contiguous whitespace in text strings it is collapsed into a single space. This matches the behavior of browser accessibility trees.

This is a breaking change because it changes the getAccessibilityTree output, and may break your snapshots. Update your snapshots with Jest and review the changes.

Since it is a breaking change I will hold off on merging it

@@ -58,24 +56,23 @@ test(
↳ description: "extended description"
text "extended description"
`);
expect(await getAccessibilityTree(body, { includeText: true }))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we changed the default value of includeText to true, this snapshot and the one above are the same. I changed the includeText property here so we test both cases.

Copy link
Contributor

@Paul-Hebert Paul-Hebert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@calebeby calebeby merged commit 847cbd8 into main Mar 31, 2022
@calebeby calebeby deleted the getAccessibilityTree-normalize-whitespace branch March 31, 2022 21:05
@github-actions github-actions bot mentioned this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants