-
Notifications
You must be signed in to change notification settings - Fork 242
test: fix ColoredBox tests on flutter 3.38
#1736
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
Conversation
Fix test failures caused by Flutter 3.38+ adding a transparent ColoredBox for page transitions (flutter/flutter#167032). Replace type-based widget finders with Key-based finders to explicitly target test widgets and avoid conflicts with framework-added ColoredBox widgets.
- Bump Flutter SDK minimum version: 3.32.0 -> 3.38.0 - Update accessibility_tools: ^2.0.0 -> ^2.8.0 Required for compatibility with MaterialApp page transition changes introduced in Flutter 3.38 (flutter/flutter#167032).
|
@SoutaTanaka is attempting to deploy a commit to the Widgetbook Team on Vercel. A member of the Team first needs to authorize it. |
|
To view this pull requests documentation preview, visit the following URL: docs.page/widgetbook/widgetbook~1736 Documentation is deployed and generated using docs.page. |
ColoredBox tests on flutter >=3.38
yousinix
left a comment
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 for your efforts to fix those tests and the detailed information! We have some little changes requested for maintaining code style and backwards compatibility.
ColoredBox tests on flutter >=3.38ColoredBox tests on flutter 3.38
|
Thank you for the review! I've addressed your feedback:
All changes have been applied. Please review when you have a chance. |
yousinix
left a comment
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 for taking care of fixing the tests! 💙
This PR updates the test suite to be compatible with Flutter 3.38+, which introduced a breaking change in
MaterialApp's page transition implementation. Flutter 3.38 added a transparentColoredBoxwidget for page transitions (flutter/flutter#167032), which caused existing tests that used type-based widget finders to fail withBad state: Too many elementserrors.The solution replaces all type-based
ColoredBoxfinders with Key-based finders, making tests more explicit and robust against framework changes. Additionally, the minimum Flutter SDK version has been bumped to 3.38.0 andaccessibility_toolshas been updated to ^2.8.0 for compatibility.List of issues which are fixed by the PR
ColoredBoxwidgets added byMaterialAppfor page transitionsBad state: Too many elementserrors inbuilder_addon_test.dart,device_frame_addon_test.dart, andcolor_knob_test.dartScreenshots
Not applicable - this PR only contains test fixes and dependency updates.
Checklist
///).If you need help, consider asking for advice on Discord.