diff --git a/test/widget/email_list_screen_test.dart b/test/widget/email_list_screen_test.dart index 01dbecb..85fda74 100644 --- a/test/widget/email_list_screen_test.dart +++ b/test/widget/email_list_screen_test.dart @@ -586,6 +586,8 @@ void main() { // Delete the email from the detail screen. await tester.tap(find.byIcon(Icons.delete)); await tester.pumpAndSettle(); + await tester.pump(); + await tester.pumpAndSettle(); // Should have popped all the way back to the mailbox list. expect(find.byType(EmailDetailScreen), findsNothing); diff --git a/test/widget/helpers.dart b/test/widget/helpers.dart index e1735bb..1e9507c 100644 --- a/test/widget/helpers.dart +++ b/test/widget/helpers.dart @@ -4,6 +4,7 @@ // as the real app) inside a ProviderScope whose repository providers are // replaced with lightweight in-memory fakes. No database or network is used. +import 'package:drift/native.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/misc.dart' show Override; @@ -27,7 +28,7 @@ import 'package:sharedinbox/core/services/account_discovery_service.dart'; import 'package:sharedinbox/core/services/connection_test_service.dart'; import 'package:sharedinbox/core/services/managesieve_probe_service.dart'; import 'package:sharedinbox/core/services/share_encryption_service.dart'; -import 'package:sharedinbox/data/db/database.dart' show SyncHealthRow; +import 'package:sharedinbox/data/db/database.dart' show AppDatabase, SyncHealthRow; import 'package:sharedinbox/di.dart'; import 'package:sharedinbox/ui/screens/account_list_screen.dart'; import 'package:sharedinbox/ui/screens/account_receive_screen.dart'; @@ -524,6 +525,11 @@ Widget buildApp({ // is still pending". Replacing it with a synchronous stream avoids this. // syncHealthProvider has the same issue and is overridden in baseOverrides. overrides: [ + dbProvider.overrideWith((ref) { + final db = AppDatabase(NativeDatabase.memory()); + ref.onDispose(db.close); + return db; + }), syncLogRepositoryProvider.overrideWithValue( const NoOpSyncLogRepository(), ),