[cupertino_ui] Migrate segmented_control_test.dart to SemanticsHandle#11982
Open
Renzo-Olivares wants to merge 2 commits into
Open
[cupertino_ui] Migrate segmented_control_test.dart to SemanticsHandle#11982Renzo-Olivares wants to merge 2 commits into
segmented_control_test.dart to SemanticsHandle#11982Renzo-Olivares wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request unskips the segmented control test file and refactors the semantics test to use SemanticsHandle and individual semantics assertions instead of SemanticsTester. The reviewer identified that find.semantics is not a valid property on CommonFinders and recommended using find.bySemanticsLabel instead for the assertions.
| ignoreId: true, | ||
| ignoreRect: true, | ||
| ignoreTransform: true, | ||
| find.semantics.byLabel('Child 1'), |
Contributor
Contributor
Author
There was a problem hiding this comment.
find.semantics does exist.
|
|
||
| // Assert Child 2 (unselected) | ||
| expect( | ||
| find.semantics.byLabel('Child 2'), |
Contributor
Contributor
Author
There was a problem hiding this comment.
find.semantics does exist.
| ignoreId: true, | ||
| ignoreRect: true, | ||
| ignoreTransform: true, | ||
| find.semantics.byLabel('Child 1'), |
Contributor
Contributor
Author
There was a problem hiding this comment.
find.semantics does exist.
|
|
||
| // Assert Child 2 (now selected and focused) | ||
| expect( | ||
| find.semantics.byLabel('Child 2'), |
Contributor
Contributor
Author
There was a problem hiding this comment.
find.semantics does exist.
segmented_control_test.dart to SemanticsHandlesegmented_control_test.dart to SemanticsHandle
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.
Part of flutter/flutter#182636 and flutter/flutter#188395
This PR:
widgets/semantics_tester.dart. ReplacedSemanticsTesterwithSemanticsHandle.@Skipannotation, all tests in this file has passed.semantics_tester.darthas existed incupertino_ui, so we can directly importsemantics_tester.dart;test/folder.Pre-Review Checklist
[shared_preferences]///).