Skip to content

Commit

Permalink
Merge pull request #135 from awhitford/testcov
Browse files Browse the repository at this point in the history
Reworked the basic smoke test to improve code coverage.
  • Loading branch information
aagarwal1012 committed Oct 23, 2020
2 parents 2324d91 + 2d3c60a commit 5b78fa0
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 5b78fa0

Please sign in to comment.