From 834f703ab9958396b1e6cddd720c3384f011ec48 Mon Sep 17 00:00:00 2001 From: Stephan Mantel Date: Tue, 28 May 2024 14:56:56 +0200 Subject: [PATCH] Revert "Run async test code directly" This reverts commit 6c736b6d7eaf13695a3aaec17ba848a34319833d. --- example/test/main_test.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/example/test/main_test.dart b/example/test/main_test.dart index 1e4b9c6e..836ea537 100644 --- a/example/test/main_test.dart +++ b/example/test/main_test.dart @@ -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 {