Skip to content

Commit

Permalink
Reworked the basic smoke test to improve code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
awhitford committed Oct 23, 2020
1 parent 4028ab0 commit 2d3c60a
Showing 1 changed file with 12 additions and 39 deletions.
51 changes: 12 additions & 39 deletions test/smoke_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

0 comments on commit 2d3c60a

Please sign in to comment.