test(Textbox): add edge cases when wrapping line#10639
Merged
Merged
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
canstand
marked this pull request as ready for review
May 28, 2025 09:42
Member
|
oh this is great thank you. I didn't forget about the segmenter, is just a busy period. |
asturur
reviewed
May 29, 2025
| expect(offset3, 'it returns always 1').toBe(1); | ||
| const expected = { | ||
| lines: ['aaa', 'aaaaaa ', ' ', 'a', 'aaaaaaa', 'aaaaa', ' aaa'], | ||
| hardBreaks: [1, 1, 1, 1, 1, 1, 1], // Note: currently, lineIndex 2 and 4 no hardBreak but still removed a space |
Member
There was a problem hiding this comment.
i remember this 1 was fixing a bug that was in fabric since long.
Can we write here, this has to be 1 and we need to be careful if this condition changes?
Contributor
Author
There was a problem hiding this comment.
Indeed, I added this comment because the test logic here needs to be modified if we want to support text with non-space line breaks. Some thoughts updated in #10606.
asturur
approved these changes
May 30, 2025
Contributor
|
Build Stats
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
While preparing #10606, I found that the existing tests were not accurate enough, so I added some edge cases.