[material_ui] Add tests for Indonesian, Korean and Thai locales tests in TimePicker l10n tests - #12948
[material_ui] Add tests for Indonesian, Korean and Thai locales tests in TimePicker l10n tests#12948AbdeMohlbi wants to merge 3 commits into
Conversation
| for (final locale in locales) { | ||
| await tester.pumpWidget( | ||
| const SizedBox(), | ||
| ); // this is needed to reset the widget tree and prevent state/Directionality leaks between loop iterations. |
There was a problem hiding this comment.
so this is necessary because using const Locale('fa', 'IR'), //'H:mm' but RTL, the x button will go to the other side which causes the hit testing to not hit test on the specified widget in the next iterations, and the following warning will appear:
Warning: A call to tap() with finder "Found 1 widget with text "X": [
Text("X", dependencies: [DefaultSelectionStyle, DefaultTextStyle, MediaQuery]),
]" derived an Offset (Offset(400.0, 300.0)) that would not hit test on the specified widget.
Maybe the widget is actually off-screen, or another widget is obscuring it, or the widget cannot receive pointer events.
The finder corresponds to this RenderBox: RenderParagraph#4315d relayoutBoundary=up13
The hit test result at that offset is: HitTestResult(RenderPointerListener#53575@Offset(124.0, 108.0), RenderSemanticsGestureHandler#e488f@Offset(124.0, 108.0), RenderPointerListener#10b37@Offset(124.0, 108.0), _RenderScrollSemantics#5bd15@Offset(124.0, 108.0), RenderClipRect#b4b84@Offset(124.0, 108.0), _RenderSingleChildViewport#1766f@Offset(124.0, 108.0), RenderIgnorePointer#c357a@Offset(124.0, 108.0), RenderSemanticsAnnotations#c6d85@Offset(124.0, 108.0), RenderPointerListener#f33fd@Offset(124.0, 108.0), RenderSemanticsGestureHandler#d85b7@Offset(124.0, 108.0), RenderPointerListener#8d4cb@Offset(124.0, 108.0), _RenderScrollSemantics#65c57@Offset(124.0, 108.0), RenderClipRect#c7224@Offset(124.0, 108.0), _RenderLayoutBuilder#e9b18@Offset(124.0, 108.0), RenderPadding#0920f@Offset(148.0, 132.0), _RenderInkFeatures#8ee06@Offset(148.0, 132.0), RenderCustomPaint#ec0c5@Offset(148.0, 132.0), RenderPhysicalShape#68177@Offset(148.0, 132.0), RenderConstrainedBox#a622e@Offset(148.0, 132.0), RenderPositionedBox#f0706@Offset(384.0, 300.0), RenderPadding#1abd3@Offset(400.0, 300.0), RenderSemanticsAnnotations#e5163@Offset(400.0, 300.0), RenderPadding#526c7@Offset(400.0, 300.0), RenderSemanticsAnnotations#29bdc@Offset(400.0, 300.0), RenderPadding#3d688@Offset(400.0, 300.0), RenderSemanticsAnnotations#b694c@Offset(400.0, 300.0), RenderRepaintBoundary#880f7@Offset(400.0, 300.0), RenderIgnorePointer#e2358@Offset(400.0, 300.0), RenderAnimatedOpacity#a7c38@Offset(400.0, 300.0), RenderRepaintBoundary#3935d@Offset(400.0, 300.0), RenderSemanticsAnnotations#516f0@Offset(400.0, 300.0), RenderOffstage#b471e@Offset(400.0, 300.0), RenderSemanticsAnnotations#f5af2@Offset(400.0, 300.0), _RenderTheater#4bd23@Offset(400.0, 300.0), RenderAbsorbPointer#4c1cf@Offset(400.0, 300.0), RenderPointerListener#1cee2@Offset(400.0, 300.0), RenderSemanticsAnnotations#2e617@Offset(400.0, 300.0), RenderCustomPaint#f4bcb@Offset(400.0, 300.0), RenderSemanticsAnnotations#60900@Offset(400.0, 300.0), RenderSemanticsAnnotations#d4d73@Offset(400.0, 300.0), RenderSemanticsAnnotations#d4f6b@Offset(400.0, 300.0), RenderTapRegionSurface#2ba9e@Offset(400.0, 300.0), RenderSemanticsAnnotations#3169a@Offset(400.0, 300.0), RenderSemanticsAnnotations#2c6d3@Offset(400.0, 300.0), HitTestEntry<HitTestTarget>#4b488(_ReusableRenderView#5b5d7), HitTestEntry<HitTestTarget>#ca173(<AutomatedTestWidgetsFlutterBinding>))
it is also possible to repro the bug with moving const Locale('fa', 'IR'), //'H:mm' but RTL as the first locale to see the same warning, not sure if this is a known bug or the expected behavior.
|
this does not require a changelog entry per https://discord.com/channels/608014603317936148/608014603317936150/1553096574668640266 |
There was a problem hiding this comment.
Code Review
This pull request adds test coverage for the 'in_ID', 'ko_KR', and 'th_TH' locales in 'time_picker_test.dart' and introduces a widget tree reset to prevent state leaks between loop iterations. The feedback highlights a duplicated and unreachable block of assertions for the new locales, as well as inconsistent quotation marks in the comments for the Korean and Thai locales.
This change adds tests for Indonesian, Korean and Thai locales tests in TimePicker i10n tests, fixing an old todo in
TimePicker l10n testsPre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2