整个课程和数据UI重新设计版本
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:kouyu_english/main.dart';
|
||||
|
||||
/// Pumps the whole app and lets `AppState.load` finish. The load reads the
|
||||
/// course packs and the AI config from the asset bundle, which is real file
|
||||
/// I/O that fake time never completes, so the test waits for it in real time
|
||||
/// until the loading spinner is gone.
|
||||
Future<void> pumpLoadedApp(WidgetTester tester) async {
|
||||
await tester.pumpWidget(const KouyuEnglishApp());
|
||||
for (var i = 0; i < 100; i++) {
|
||||
if (find.byType(CircularProgressIndicator).evaluate().isEmpty) break;
|
||||
await tester.runAsync(
|
||||
() => Future<void>.delayed(const Duration(milliseconds: 20)),
|
||||
);
|
||||
await tester.pump();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user