From 2d3c60a49971c0587230c38705d21e9142e72841 Mon Sep 17 00:00:00 2001 From: Anthony Whitford Date: Fri, 23 Oct 2020 15:00:42 -0700 Subject: [PATCH] Reworked the basic smoke test to improve code coverage. --- test/smoke_test.dart | 51 +++++++++++--------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/test/smoke_test.dart b/test/smoke_test.dart index 50c3966..aadcf14 100644 --- a/test/smoke_test.dart +++ b/test/smoke_test.dart @@ -7,44 +7,17 @@ void main() { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); - expect(find.text(labels[0]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[1]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[2]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[3]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[4]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[5]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[6]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); - - expect(find.text(labels[7]), findsOneWidget); - - await tester.tap(find.byIcon(Icons.play_circle_filled)); - await tester.pump(); + // Exercise each Animation... + for (var label in labels) { + print('Testing $label'); + expect(find.text(label), findsOneWidget); + final pumpCount = await tester.pumpAndSettle(); + print(' > $label pumped $pumpCount'); + + await tester.tap(find.byIcon(Icons.play_circle_filled)); + await tester.pump(); + } + + tester.verifyTickersWereDisposed(); }); }