futuristic icon indicating copy to clipboard operation
futuristic copied to clipboard

There is no test for autostart = true

Open ride4sun opened this issue 4 years ago • 0 comments

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);
    });

ride4sun avatar Oct 07 '20 21:10 ride4sun