Specify widget height in EditableText shortcuts tests#98607
Specify widget height in EditableText shortcuts tests#98607fluttergithubbot merged 5 commits intoflutter:masterfrom tgucio:editable-text-test
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
There was a problem hiding this comment.
unrelated to this PR, but maybe you can fix it nonetheless: I just notices that this fail is named incorrectly. It should end in _test.dart instead of _tests.dart. Could you maybe rename it?
There was a problem hiding this comment.
(I wonder if that naming problem actually means that this test doesn't run as part of our CI)
There was a problem hiding this comment.
Right, this would explain why this wasn't caught before. As far as I can tell this should have started failing after #97446 (before that TextPainter's line metrics cache wasn't cleared and as a result vertical runs could be jumping to incorrect offsets).
It appears to be the only file with "_tests" instead of "_test" in the name:
% find . -name "*_tests.dart"
./test/widgets/editable_text_shortcuts_tests.dart
Let me change it and update the PR.
There was a problem hiding this comment.
Another interesting fact is that since vertical runs rely on the line metrics cache which will get emptied on each getMin/MaxIntrinsic*() call, they won't work in EditableText widgets that don't have fixed width+height (each vertical run will be invalidated on widget update right after the caret moves). That is to say, the cursor will move up/down but perhaps not to the horizontal location we'd expect.
|
@LongCatIsLooong I believe these should be skipped altogether on web, just like the common shortcuts tests. I've added "skip: kIsWeb". |
| )); | ||
| }, variant: macOSOnly); | ||
| }); | ||
| }, skip: kIsWeb); // [intended] |
There was a problem hiding this comment.
this needs a comment saying why it is ok to skip these on web. (see other examples of this in the repository)
There was a problem hiding this comment.
Updated this one and other comments on "skip: kIsWeb" in the file.
|
EDIT: ok, just found #99036 @goderbauer Tree issue or renaming the test file somehow triggered this? |
|
@goderbauer Had to merge + kick the tests with empty amend commits a few times due to some other unrelated tests failing but this should be good to go now. |
Fixes test issue #98592 by specifying widget height.
When manually running EditableText tests, some shortcuts tests were failing.
This was because vertical runs on up/down arrow keys were stopped due to the following:
Pre-launch Checklist
///).