-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Fix losing undo/redo history when using non-breaking space HTML entity #57652
Merged
fluiddot
merged 7 commits into
trunk
from
rnmobile/fix/undo-redo-non-breaking-space-entity
Jan 10, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3991db3
Stop removing non-breaking space HTML entity
fluiddot a2a7b9a
Use `render` from test helpers in RichText unit tests
fluiddot e27f0e9
Rename describe section in RichText unit tests
fluiddot d80f70c
Use `RichTextData.empty` to create empty value in RichText unit tests
fluiddot 307e15e
Add test case to cover non-breaking space HTML entity
fluiddot 870a99a
Update `describe` description in RichText unit tests
fluiddot ef2802e
Update snapshots of `RichText` unit tests
fluiddot 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 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 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 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
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.
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.
It is fine if you'd like to change this formatting, but, for my own education, may I ask the rationale behind dropping the "when..." format?
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.
I renamed it mainly to make the section more open to other test cases like the one added in the PR. The formatting change was mainly driven by using the same we have in the other
describe
section:gutenberg/packages/block-editor/src/components/rich-text/native/test/index.native.js
Line 148 in 307e15e
In any case, I don't have a strong opinion on the formatting. We could still use
when...
, but if prefer this option, it would be great to make it consistent across the file.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.
Thank you for sharing. In short, I support you if you would like to change this format. Expanding the section, more specifically removing
from Aztec
, makes complete sense. From my perspective, that expanded group description is a logical test case grouping to avoid repetition.My longer response, if you are interested... 😄
I am all for consistency. That said, at this time, I would argue that we do not have a consistent approach established. For this specific example, even
Font Size
andValue changes
differ on casing. Admittedly, casing is not an important thing by any means, but I figure it is relevant nonetheless.My original goal with my inquiry was to avoid a situation where we (contributors) swap code back and forth. Without automated enforcement via a linter, it is difficult to ensure consistency. There are examples of the "when" formatting in the code base as well. That is not to say we must adhere to that, but, again, I inquired to understand the rationale for modifying this one location.
For context, I was taught the "when" pattern as an approach to make test output read as a sentence. I.e.,
[subject] when [context] should [expectation]
. Again, not advocating that we adhere to this format, merely sharing my rationale.Thank you for considering my perspective. 🙇🏻
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.
Thanks @dcalhoun for elaborating on your response 🙇 !
Ah, good point. I'll update the description to match the casing.
Yep, we don't have a clear guideline about the
describe
section. I checked the Gutenberg documentation about testing but there's no explicit reference to thedescribe
statement, apart from the following:Using
when
, although a bit more verbose, I agree it's a format more aligned with the description in test cases. I'll update it for this file. Thanks 🙇 !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.
I applied this suggestion in 870a99a.