-
Notifications
You must be signed in to change notification settings - Fork 355
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
chore(tests) fixate time format #8691
Conversation
Preview: https://patternfly-react-pr-8691.surge.sh A11y report: https://patternfly-react-pr-8691-a11y.surge.sh |
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.
Solves the issue. Good job
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.
looking good in the US
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.
Is it just me or is the diff in that snapshot showing the same thing on each line? |
yea.. i can't see a difference.. maybe a different type of space character or something? i'd be curious in you copying the line in question and converting the text to code representation (https://www.online-toolz.com/tools/text-unicode-entities-convertor.php).. then updating the snapshot and doing the same, see if something changed. |
Yes, you are both right. It is a problem with the space just before "AM" (or PM in the next test). This is the snapshot: 1/1/2022%2C%2012%3A00%3A00 And this is actually received: 1/1/2022%2C%2012%3A00%3A00 |
It seems, that Here is a suggestion, how it could be repaired: timestamp test repair commit I have edited the tests, so they replace the 'NARROW NO-BREAK SPACE' with classic space before calling the I did not find an easy way to modify Anyway, overall I don't think this is a great solution, it seems to me like only "hiding a problem" by this conversion of nbsp to space character -- and it could create some other troubles in the future. |
It actually might be a Node version issue. To reproduce the bug: I am using node v18.14.0, yarn 1.22.19 |
Slightly better solution than explicitly replacing spaces in the tested string might be to use normalization. Tested strings are getting normalized, which seems to mess up the spaces. We can configure the normalization like this: |
screenshot is based on what the app produces, so if you normalize it in the app (timestamp component?) it will update the screenshot that way. |
Yeah, but the matchers are getting normalized and not what gets rendered. And since snapshots are not getting matched, we can't use normalization on them. And the code snapshot produces can't be easily modified because we would have to modify the Timestamp component itself. See Adam's comment |
If it's a Node version issue would it potentially be resolved as part of #8303? |
What: Closes #8690