From cc86da476eb71e26752b47b8069f6f7edc880695 Mon Sep 17 00:00:00 2001 From: DatDang Date: Thu, 3 Oct 2024 08:52:54 +0700 Subject: [PATCH] fixup! TF-3034 Prevent duplicate draft warning --- core/lib/utils/platform_info.dart | 12 ++++++------ .../presentation/composer_controller_test.dart | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/lib/utils/platform_info.dart b/core/lib/utils/platform_info.dart index 72c002b8f1..f7f0edc190 100644 --- a/core/lib/utils/platform_info.dart +++ b/core/lib/utils/platform_info.dart @@ -7,12 +7,12 @@ abstract class PlatformInfo { static bool isTestingForWeb = false; static bool get isWeb => kIsWeb || isTestingForWeb; - static bool get isLinux => !kIsWeb && defaultTargetPlatform == TargetPlatform.linux; - static bool get isWindows => !kIsWeb && defaultTargetPlatform == TargetPlatform.windows; - static bool get isMacOS => !kIsWeb && defaultTargetPlatform == TargetPlatform.macOS; - static bool get isFuchsia => !kIsWeb && defaultTargetPlatform == TargetPlatform.fuchsia; - static bool get isIOS => !kIsWeb && defaultTargetPlatform == TargetPlatform.iOS; - static bool get isAndroid => !kIsWeb && defaultTargetPlatform == TargetPlatform.android; + static bool get isLinux => !isWeb && defaultTargetPlatform == TargetPlatform.linux; + static bool get isWindows => !isWeb && defaultTargetPlatform == TargetPlatform.windows; + static bool get isMacOS => !isWeb && defaultTargetPlatform == TargetPlatform.macOS; + static bool get isFuchsia => !isWeb && defaultTargetPlatform == TargetPlatform.fuchsia; + static bool get isIOS => !isWeb && defaultTargetPlatform == TargetPlatform.iOS; + static bool get isAndroid => !isWeb && defaultTargetPlatform == TargetPlatform.android; static bool get isMobile => isAndroid || isIOS; static bool get isDesktop => isLinux || isWindows || isMacOS; static bool get isCanvasKit => isRendererCanvasKit; diff --git a/test/features/composer/presentation/composer_controller_test.dart b/test/features/composer/presentation/composer_controller_test.dart index 790c331df8..2ca4c52fa9 100644 --- a/test/features/composer/presentation/composer_controller_test.dart +++ b/test/features/composer/presentation/composer_controller_test.dart @@ -200,7 +200,7 @@ void main() { final mockRichTextWebController = MockRichTextWebController(); // Declaration misc dependencies - final mockHtmlEditorApi = MockHtmlEditorApi(); + late MockHtmlEditorApi mockHtmlEditorApi; setUp(() { Get.testMode = true; @@ -269,6 +269,8 @@ void main() { mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor ); + + mockHtmlEditorApi = MockHtmlEditorApi(); }); tearDown(() {