From 450e0eb2abc64aed2ef8dc59109edcf2286baeb2 Mon Sep 17 00:00:00 2001 From: dab246 Date: Fri, 17 May 2024 02:19:22 +0700 Subject: [PATCH] TF-2764 Remove ViewAttachmentForWebInteractor --- .../state/view_attachment_for_web_state.dart | 29 -- .../view_attachment_for_web_interactor.dart | 75 ------ ...ew_attachment_for_web_interactor_test.dart | 255 ------------------ .../single_email_controller_test.dart | 119 +------- .../presentation/home_controller_test.dart | 23 +- .../presentation/login_controller_test.dart | 16 +- .../mailbox_dashboard_controller_test.dart | 18 +- 7 files changed, 52 insertions(+), 483 deletions(-) delete mode 100644 lib/features/email/domain/state/view_attachment_for_web_state.dart delete mode 100644 lib/features/email/domain/usecases/view_attachment_for_web_interactor.dart delete mode 100644 test/features/email/domain/usecases/view_attachment_for_web_interactor_test.dart diff --git a/lib/features/email/domain/state/view_attachment_for_web_state.dart b/lib/features/email/domain/state/view_attachment_for_web_state.dart deleted file mode 100644 index 96dcaab06..000000000 --- a/lib/features/email/domain/state/view_attachment_for_web_state.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:tmail_ui_user/features/email/domain/state/download_attachment_for_web_state.dart'; - -class IdleViewAttachmentForWeb extends IdleDownloadAttachmentForWeb {} - -class StartViewAttachmentForWeb extends StartDownloadAttachmentForWeb { - StartViewAttachmentForWeb(super.taskId, super.attachment); -} - -class ViewingAttachmentForWeb extends DownloadingAttachmentForWeb { - ViewingAttachmentForWeb( - super.taskId, - super.attachment, - super.progress, - super.downloaded, - super.total, - ); -} - -class ViewAttachmentForWebSuccess extends DownloadAttachmentForWebSuccess { - ViewAttachmentForWebSuccess(super.taskId, super.attachment, super.bytes); -} - -class ViewAttachmentForWebFailure extends DownloadAttachmentForWebFailure { - ViewAttachmentForWebFailure({ - required super.attachment, - super.taskId, - super.exception, - }); -} diff --git a/lib/features/email/domain/usecases/view_attachment_for_web_interactor.dart b/lib/features/email/domain/usecases/view_attachment_for_web_interactor.dart deleted file mode 100644 index fc318bf9e..000000000 --- a/lib/features/email/domain/usecases/view_attachment_for_web_interactor.dart +++ /dev/null @@ -1,75 +0,0 @@ -import 'dart:async'; - -import 'package:core/presentation/state/failure.dart'; -import 'package:core/presentation/state/success.dart'; -import 'package:dartz/dartz.dart'; -import 'package:jmap_dart_client/jmap/account_id.dart'; -import 'package:model/download/download_task_id.dart'; -import 'package:model/email/attachment.dart'; -import 'package:tmail_ui_user/features/email/domain/state/download_attachment_for_web_state.dart'; -import 'package:tmail_ui_user/features/email/domain/state/view_attachment_for_web_state.dart'; -import 'package:tmail_ui_user/features/email/domain/usecases/download_attachment_for_web_interactor.dart'; - -class ViewAttachmentForWebInteractor { - ViewAttachmentForWebInteractor(this._downloadAttachmentForWebInteractor); - - final DownloadAttachmentForWebInteractor _downloadAttachmentForWebInteractor; - - Stream> execute( - DownloadTaskId taskId, - Attachment attachment, - AccountId accountId, - String baseDownloadUrl, - StreamController> onReceiveController, - ) => - _downloadAttachmentForWebInteractor - .execute( - taskId, - attachment, - accountId, - baseDownloadUrl, - onReceiveController) - .map( - (result) => result.fold( - (failure) { - if (failure is DownloadAttachmentForWebFailure) { - return Left(ViewAttachmentForWebFailure( - attachment: attachment, - taskId: failure.taskId, - exception: failure.exception, - )); - } - - return Left(failure); - }, - (success) { - if (success is StartDownloadAttachmentForWeb) { - return Right(StartViewAttachmentForWeb( - success.taskId, - success.attachment, - )); - } - - if (success is DownloadingAttachmentForWeb) { - return Right(ViewingAttachmentForWeb( - success.taskId, - success.attachment, - success.progress, - success.downloaded, - success.total, - )); - } - - if (success is DownloadAttachmentForWebSuccess) { - return Right(ViewAttachmentForWebSuccess( - success.taskId, - success.attachment, - success.bytes, - )); - } - - return Right(success); - }, - ), - ); -} diff --git a/test/features/email/domain/usecases/view_attachment_for_web_interactor_test.dart b/test/features/email/domain/usecases/view_attachment_for_web_interactor_test.dart deleted file mode 100644 index ba4fe053c..000000000 --- a/test/features/email/domain/usecases/view_attachment_for_web_interactor_test.dart +++ /dev/null @@ -1,255 +0,0 @@ -import 'dart:async'; - -import 'package:core/presentation/state/failure.dart'; -import 'package:core/presentation/state/success.dart'; -import 'package:dartz/dartz.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:jmap_dart_client/jmap/account_id.dart'; -import 'package:jmap_dart_client/jmap/core/id.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; -import 'package:model/download/download_task_id.dart'; -import 'package:model/email/attachment.dart'; -import 'package:tmail_ui_user/features/email/domain/state/download_attachment_for_web_state.dart'; -import 'package:tmail_ui_user/features/email/domain/state/view_attachment_for_web_state.dart'; -import 'package:tmail_ui_user/features/email/domain/usecases/download_attachment_for_web_interactor.dart'; -import 'package:tmail_ui_user/features/email/domain/usecases/view_attachment_for_web_interactor.dart'; - -import 'view_attachment_for_web_interactor_test.mocks.dart'; - -@GenerateNiceMocks([ - MockSpec(), - MockSpec(), - MockSpec(), -]) -void main() { - final testDownloadAttachmentForWebInteractor = - MockDownloadAttachmentForWebInteractor(); - final viewAttachmentForWebInteractor = - ViewAttachmentForWebInteractor(testDownloadAttachmentForWebInteractor); - - final testDownloadTaskId = DownloadTaskId('123'); - final testAttachment = Attachment(); - final testAccountId = AccountId(Id('id')); - final testException = TimeoutException('321'); - const testBaseDownloadUrl = 'base_download_url'; - final testReceiveController = StreamController>(); - final testFailure = MockFailure(); - final testSuccess = MockSuccess(); - final testBytes = Uint8List(12); - - group('View attachment for web interactor', () { - test( - 'should yield ViewAttachmentForWebFailure ' - 'when downloadAttachmentForWebInteractor yield DownloadAttachmentForWebFailure', - () { - // arrange - when(testDownloadAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - )).thenAnswer( - (_) => Stream.value( - Left( - DownloadAttachmentForWebFailure( - attachment: testAttachment, - taskId: testDownloadTaskId, - exception: testException, - ), - ), - ), - ); - - // assert - expect( - viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - ), - emitsInOrder([ - Left( - ViewAttachmentForWebFailure( - attachment: testAttachment, - taskId: testDownloadTaskId, - exception: testException, - ), - ) - ]), - ); - }, - ); - - test( - 'should yield Failure ' - 'when downloadAttachmentForWebInteractor doesn\'t yield DownloadAttachmentForWebFailure', - () { - // arrange - when(testDownloadAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - )).thenAnswer((_) => Stream.value(Left(testFailure))); - - // assert - expect( - viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - ), - emitsInOrder([Left(testFailure)]), - ); - }, - ); - - test( - 'should yield StartViewAttachmentForWeb ' - 'when downloadAttachmentForWebInteractor yield StartDownloadAttachmentForWeb', - () { - // arrange - when(testDownloadAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - )).thenAnswer((_) => Stream.value( - Right(StartDownloadAttachmentForWeb( - testDownloadTaskId, - testAttachment, - )), - )); - - // assert - expect( - viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - ), - emitsInOrder([ - Right(StartViewAttachmentForWeb( - testDownloadTaskId, - testAttachment, - )) - ]), - ); - }, - ); - - test( - 'should yield ViewingAttachmentForWeb ' - 'when downloadAttachmentForWebInteractor yield DownloadingAttachmentForWeb', - () { - // arrange - when(testDownloadAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - )).thenAnswer( - (_) => Stream.fromIterable([ - Right(DownloadingAttachmentForWeb(testDownloadTaskId, testAttachment, 0.5, 1, 2)), - Right(DownloadingAttachmentForWeb(testDownloadTaskId, testAttachment, 1, 1, 2)), - Right(DownloadingAttachmentForWeb(testDownloadTaskId, testAttachment, 1, 2, 2)), - ]), - ); - - // assert - expect( - viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - ), - emitsInOrder([ - Right(ViewingAttachmentForWeb(testDownloadTaskId, testAttachment, 0.5, 1, 2)), - Right(ViewingAttachmentForWeb(testDownloadTaskId, testAttachment, 1, 1, 2)), - Right(ViewingAttachmentForWeb(testDownloadTaskId, testAttachment, 1, 2, 2)), - ]), - ); - }, - ); - - test( - 'should yield ViewAttachmentForWebSuccess ' - 'when downloadAttachmentForWebInteractor yield DownloadAttachmentForWebSuccess', - () { - // arrange - when(testDownloadAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - )).thenAnswer((_) => Stream.value( - Right(DownloadAttachmentForWebSuccess( - testDownloadTaskId, - testAttachment, - testBytes, - )), - )); - - // assert - expect( - viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - ), - emitsInOrder([ - Right(ViewAttachmentForWebSuccess( - testDownloadTaskId, - testAttachment, - testBytes, - )), - ]), - ); - }, - ); - - test( - 'should yield Success ' - 'when downloadAttachmentForWebInteractor yield state doesn\'t match any of the above', - () { - // arrange - when(testDownloadAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - )).thenAnswer((_) => Stream.value(Right(testSuccess))); - - // assert - expect( - viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - testBaseDownloadUrl, - testReceiveController, - ), - emitsInOrder([Right(testSuccess)]), - ); - }, - ); - }); -} diff --git a/test/features/email/presentation/controller/single_email_controller_test.dart b/test/features/email/presentation/controller/single_email_controller_test.dart index 465993fec..e5cc10875 100644 --- a/test/features/email/presentation/controller/single_email_controller_test.dart +++ b/test/features/email/presentation/controller/single_email_controller_test.dart @@ -2,28 +2,21 @@ import 'dart:ui'; import 'package:core/core.dart'; import 'package:dartz/dartz.dart' hide State; -import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:get/get.dart'; -import 'package:http_parser/http_parser.dart'; import 'package:jmap_dart_client/jmap/account_id.dart'; import 'package:jmap_dart_client/jmap/core/capability/calendar_event_capability.dart'; import 'package:jmap_dart_client/jmap/core/capability/capability_identifier.dart'; import 'package:jmap_dart_client/jmap/core/id.dart'; -import 'package:jmap_dart_client/jmap/core/session/session.dart'; -import 'package:jmap_dart_client/jmap/core/state.dart'; -import 'package:jmap_dart_client/jmap/core/user_name.dart'; import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart'; import 'package:jmap_dart_client/jmap/mail/calendar/reply/calendar_event_accept_response.dart'; import 'package:jmap_dart_client/jmap/mail/email/email.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:model/model.dart'; import 'package:tmail_ui_user/features/caching/caching_manager.dart'; import 'package:tmail_ui_user/features/email/domain/model/event_action.dart'; import 'package:tmail_ui_user/features/email/domain/state/calendar_event_accept_state.dart'; import 'package:tmail_ui_user/features/email/domain/state/parse_calendar_event_state.dart'; -import 'package:tmail_ui_user/features/email/domain/state/view_attachment_for_web_state.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/calendar_event_accept_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/maybe_calendar_event_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/calendar_event_reject_interactor.dart'; @@ -37,7 +30,6 @@ import 'package:tmail_ui_user/features/email/domain/usecases/move_to_mailbox_int import 'package:tmail_ui_user/features/email/domain/usecases/print_email_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/store_event_attendance_status_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/store_opened_email_interactor.dart'; -import 'package:tmail_ui_user/features/email/domain/usecases/view_attachment_for_web_interactor.dart'; import 'package:tmail_ui_user/features/email/presentation/controller/email_supervisor_controller.dart'; import 'package:tmail_ui_user/features/email/presentation/controller/single_email_controller.dart'; import 'package:tmail_ui_user/features/email/presentation/model/blob_calendar_event.dart'; @@ -71,7 +63,6 @@ const fallbackGenerators = { MockSpec(), MockSpec(), MockSpec(), - MockSpec(), MockSpec(fallbackGenerators: fallbackGenerators), MockSpec(fallbackGenerators: fallbackGenerators), MockSpec(fallbackGenerators: fallbackGenerators), @@ -91,6 +82,7 @@ const fallbackGenerators = { MockSpec(), MockSpec(), MockSpec(), + MockSpec(), ]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -106,7 +98,6 @@ void main() { MockDownloadAttachmentForWebInteractor(); final getAllIdentitiesInteractor = MockGetAllIdentitiesInteractor(); final storeOpenedEmailInteractor = MockStoreOpenedEmailInteractor(); - final viewAttachmentForWebInteractor = MockViewAttachmentForWebInteractor(); final mailboxDashboardController = MockMailboxDashBoardController(); final emailSupervisorController = MockEmailSupervisorController(); final downloadManager = MockDownloadManager(); @@ -123,6 +114,7 @@ void main() { final uuid = MockUuid(); final printEmailInteractor = MockPrintEmailInteractor(); final storeEventAttendanceStatusInteractor = MockStoreEventAttendanceStatusInteractor(); + final printUtils = MockPrintUtils(); late SingleEmailController singleEmailController; @@ -135,8 +127,6 @@ void main() { ), }, {}, {}, UserName('data'), google, google, google, google, State('1')); const testTaskId = 'taskId'; - final testDownloadTaskId = DownloadTaskId(testTaskId); - final testBytes = Uint8List(123); setUpAll(() { Get.put(mailboxDashboardController); @@ -157,6 +147,7 @@ void main() { Get.put(imagePaths); Get.put(responsiveUtils); Get.put(uuid); + Get.put(printUtils); when(mailboxDashboardController.accountId).thenReturn(Rxn(testAccountId)); when(uuid.v4()).thenReturn(testTaskId); @@ -174,115 +165,11 @@ void main() { downloadAttachmentForWebInteractor, getAllIdentitiesInteractor, storeOpenedEmailInteractor, - viewAttachmentForWebInteractor, printEmailInteractor, storeEventAttendanceStatusInteractor, ); }); - group('single email controller', () { - test( - 'should call execute on ViewAttachmentForWebInteractor ' - 'when viewAttachmentForWeb is called', - () { - // arrange - when(mailboxDashboardController.sessionCurrent).thenReturn(testSession); - final testAttachment = Attachment(); - - // act - singleEmailController.viewAttachmentForWeb(testAttachment); - - // assert - verify(viewAttachmentForWebInteractor.execute( - any, - testAttachment, - testAccountId, - any, - any, - )).called(1); - }, - ); - - test( - 'should trigger mailboxDashBoardController.deleteDownloadTask & downloadManager.openDownloadedFileWeb' - 'when attachment mime type is pdf', - () async { - // arrange - const attachmentName = 'test_name.pdf'; - final testAttachment = Attachment( - type: MediaType('application', 'pdf'), - name: attachmentName); - when(mailboxDashboardController.sessionCurrent).thenReturn(testSession); - when(viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - any, - any, - )).thenAnswer((_) => Stream.value( - right(ViewAttachmentForWebSuccess( - testDownloadTaskId, - testAttachment, - testBytes, - )), - )); - - // act - singleEmailController.viewAttachmentForWeb(testAttachment); - - // assert - await untilCalled(mailboxDashboardController.deleteDownloadTask(any)); - verify(mailboxDashboardController.deleteDownloadTask(testDownloadTaskId)) - .called(1); - await untilCalled(downloadManager.openDownloadedFileWeb(any, any, any)); - verify(downloadManager.openDownloadedFileWeb( - testBytes, - Constant.pdfMimeType, - attachmentName, - )).called(1); - }, - ); - - test( - 'should trigger mailboxDashBoardController.deleteDownloadTask & downloadManager.createAnchorElementDownloadFileWeb' - 'when attachment mime type is not pdf', - () async { - // arrange - const testFileName = 'test_file.txt'; - final testAttachment = Attachment(name: testFileName); - when(mailboxDashboardController.sessionCurrent).thenReturn(testSession); - when(viewAttachmentForWebInteractor.execute( - testDownloadTaskId, - testAttachment, - testAccountId, - any, - any, - )).thenAnswer((_) => Stream.value( - right(ViewAttachmentForWebSuccess( - testDownloadTaskId, - testAttachment, - testBytes, - )), - )); - - // act - singleEmailController.viewAttachmentForWeb(testAttachment); - - // assert - await untilCalled(mailboxDashboardController.deleteDownloadTask(any)); - verify(mailboxDashboardController.deleteDownloadTask(testDownloadTaskId)) - .called(1); - await untilCalled( - downloadManager.createAnchorElementDownloadFileWeb(any, any), - ); - verify(downloadManager.createAnchorElementDownloadFileWeb( - testBytes, - testFileName, - )).called(1); - }, - ); - }); - group('calendar event reply test:', () { final blobId = Id('abc123'); final emailId = EmailId(Id('xyz123')); diff --git a/test/features/home/presentation/home_controller_test.dart b/test/features/home/presentation/home_controller_test.dart index 76f74939d..77f089ec2 100644 --- a/test/features/home/presentation/home_controller_test.dart +++ b/test/features/home/presentation/home_controller_test.dart @@ -26,22 +26,35 @@ import 'package:tmail_ui_user/features/login/domain/usecases/update_authenticati import 'package:tmail_ui_user/features/manage_account/data/local/language_cache_manager.dart'; import 'package:tmail_ui_user/features/manage_account/domain/usecases/log_out_oidc_interactor.dart'; import 'package:tmail_ui_user/main/bindings/network/binding_tag.dart'; +import 'package:tmail_ui_user/main/utils/email_receive_manager.dart'; import 'package:uuid/uuid.dart'; -import '../../email/presentation/controller/single_email_controller_test.mocks.dart'; -import '../../mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.mocks.dart'; import 'home_controller_test.mocks.dart'; @GenerateNiceMocks([ + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), ]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); - late HomeController homeController; late MockCleanupEmailCacheInteractor cleanupEmailCacheInteractor; late MockEmailReceiveManager emailReceiveManager; @@ -53,8 +66,8 @@ void main() { late MockGetAuthenticatedAccountInteractor mockGetAuthenticatedAccountInteractor; late MockUpdateAuthenticationAccountInteractor mockUpdateAuthenticationAccountInteractor; - late CachingManager mockCachingManager; - late LanguageCacheManager mockLanguageCacheManager; + late MockCachingManager mockCachingManager; + late MockLanguageCacheManager mockLanguageCacheManager; late MockAuthorizationInterceptors mockAuthorizationInterceptors; late MockDynamicUrlInterceptors mockDynamicUrlInterceptors; late MockDeleteCredentialInteractor mockDeleteCredentialInteractor; diff --git a/test/features/login/presentation/login_controller_test.dart b/test/features/login/presentation/login_controller_test.dart index bb8972667..745551b98 100644 --- a/test/features/login/presentation/login_controller_test.dart +++ b/test/features/login/presentation/login_controller_test.dart @@ -35,11 +35,18 @@ import 'package:tmail_ui_user/features/manage_account/domain/usecases/log_out_oi import 'package:tmail_ui_user/main/bindings/network/binding_tag.dart'; import 'package:uuid/uuid.dart'; -import '../../email/presentation/controller/single_email_controller_test.mocks.dart'; -import '../../mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.mocks.dart'; import 'login_controller_test.mocks.dart'; @GenerateNiceMocks([ + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), @@ -53,6 +60,11 @@ import 'login_controller_test.mocks.dart'; MockSpec(), MockSpec(), MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), ]) void main() { late MockAuthenticationInteractor mockAuthenticationInteractor; diff --git a/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart b/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart index dd7438d49..d8b85c58a 100644 --- a/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart +++ b/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart @@ -26,6 +26,9 @@ import 'package:tmail_ui_user/features/composer/domain/usecases/update_email_dra import 'package:tmail_ui_user/features/email/domain/usecases/delete_email_permanently_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/delete_multiple_emails_permanently_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/get_restored_deleted_message_interactor.dart'; +import 'package:tmail_ui_user/features/email/domain/usecases/mark_as_email_read_interactor.dart'; +import 'package:tmail_ui_user/features/email/domain/usecases/mark_as_star_email_interactor.dart'; +import 'package:tmail_ui_user/features/email/domain/usecases/move_to_mailbox_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/restore_deleted_message_interactor.dart'; import 'package:tmail_ui_user/features/email/domain/usecases/unsubscribe_email_interactor.dart'; import 'package:tmail_ui_user/features/home/domain/usecases/get_session_interactor.dart'; @@ -92,7 +95,6 @@ import 'package:tmail_ui_user/features/network_connection/presentation/network_c if (dart.library.html) 'package:tmail_ui_user/features/network_connection/presentation/web_network_connection_controller.dart'; import 'package:uuid/uuid.dart'; -import '../../../email/presentation/controller/single_email_controller_test.mocks.dart'; import 'mailbox_dashboard_controller_test.mocks.dart'; mockControllerCallback() => InternalFinalCallback(callback: () {}); @@ -103,6 +105,9 @@ const fallbackGenerators = { @GenerateNiceMocks([ // write mock specs for unavailable dependencies + MockSpec(), + MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), @@ -153,6 +158,17 @@ const fallbackGenerators = { MockSpec(), MockSpec(), MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), ]) void main() { // mock mailbox dashboard controller direct dependencies