Skip to content

Commit

Permalink
Revert "Run async test code directly"
Browse files Browse the repository at this point in the history
This reverts commit 6c736b6.
  • Loading branch information
stephanmantel committed May 28, 2024
1 parent 6c736b6 commit 834f703
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions example/test/main_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ void main() {
});

testWidgets('Tapping save stores task in database', (tester) async {
await tester.pumpWidget(FloorApp(taskDao));
final textFieldFinder = find.byType(TextField);
final raisedButtonFinder = find.byType(OutlinedButton);
await tester.runAsync(() async {
await tester.pumpWidget(FloorApp(taskDao));
final textFieldFinder = find.byType(TextField);
final raisedButtonFinder = find.byType(OutlinedButton);

await tester.enterText(textFieldFinder, 'Hello world!');
await tester.tap(raisedButtonFinder);
await tester.enterText(textFieldFinder, 'Hello world!');
await tester.tap(raisedButtonFinder);

final tasks = await taskDao.findAllTasks();
expect(tasks, isNotEmpty);
final tasks = await taskDao.findAllTasks();
expect(tasks, isNotEmpty);
});
});

testWidgets('Tapping save clears text input field', (tester) async {
Expand Down

0 comments on commit 834f703

Please sign in to comment.