-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: normalize whitespace to expect().toHaveValue() #34818
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change. Please put this behaviour change behind a flag, as pointed out in #23037 (comment). It should be configurable from expect().toHaveValue()
as well.
3d91c38
to
ec31aa5
Compare
This comment has been minimized.
This comment has been minimized.
Thanks for nice feedback. After adding the normalize flag to await expect(locator).toHaveValue('Text and content'); However, third-party matchers—such as Additionally, none of the current matchers expose the normalizeWhiteSpace option externally. Following the team's existing approach, I have added the normalizeWhiteSpace flag accordingly. If the team later decides this flag should be exposed externally, I’d be happy to add it in a subsequent commit. :) |
This comment has been minimized.
This comment has been minimized.
I'm not even sure we want to accept the patch, the issue does not sound convincing to me. Value is a value, so we should compare it as such with no tolerance for error. |
@pavelfeldman |
9bf7589
to
730ab5d
Compare
This comment has been minimized.
This comment has been minimized.
730ab5d
to
f9dd535
Compare
Test results for "tests 1"6 flaky38678 passed, 794 skipped Merge workflow run. |
Closes #23037
This PR fixes the issue where inputValue returns non-breaking spaces (NBSP, U+00A0) instead of regular spaces. The previous PR attempted to address the problem within toHaveValue, but the root cause was identified as inputValue itself returning U+00A0.
Additionally, if you could share reproduction steps or documentation (as mentioned in the previous PR feedback regarding web browser tests), it would greatly help in future improvements.
Thank you.