test(theme): load the deferred locale off the widget tester's fake clock
`await LocaleSettings.setLocale` inside a `testWidgets` body waits on a deferred library load that only completes on the real event loop, so the regex-dialog test hung indefinitely rather than failing. It passed only because an earlier plain `test` in the same file loads `de` first — running the file alone, under a name filter, or sharded apart from that test stalled the run until the ten-minute timeout.
This commit is contained in:
@@ -184,7 +184,12 @@ void main() {
|
||||
});
|
||||
|
||||
testWidgets('regex dialog localizes its field label and validation error', (tester) async {
|
||||
await LocaleSettings.setLocale(AppLocale.de);
|
||||
// `runAsync`: a deferred locale library loads on the real event loop, and
|
||||
// the widget tester's fake async never pumps it. Awaiting the load
|
||||
// directly hangs the test whenever the library is not already resident —
|
||||
// running this file alone, under a name filter, or sharded away from the
|
||||
// `themeModeLabel` test above that happens to load `de` first.
|
||||
await tester.runAsync(() => LocaleSettings.setLocale(AppLocale.de));
|
||||
addTearDown(() => LocaleSettings.setLocaleSync(AppLocale.en));
|
||||
|
||||
await tester.pumpWidget(
|
||||
|
||||
Reference in New Issue
Block a user