futuristic
futuristic copied to clipboard
There is no test for autostart = true
trivial but important to test the good cases
testWidgets(
'shows dataBuilder after future completes successfully with autostart',
(tester) async {
final text = '3';
final widget = MaterialApp(
home: Futuristic(
futureBuilder: () => goodFuture(),
autoStart: true,
busyBuilder: (_) => CircularProgressIndicator(),
dataBuilder: (_, data) => Text(text),
),
);
await tester.pumpWidget(widget);
await tester.pump();
await tester.pump();
expect(find.text(text), findsOneWidget);
});