Migrate v0.11.3-patch4-dev to master branch

This commit is contained in:
dab246
2024-06-05 16:19:03 +07:00
committed by Dat H. Pham
parent 1e180f0022
commit 2a862e5a05
28 changed files with 161 additions and 76 deletions
@@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:core/core.dart';
import 'package:core/utils/application_manager.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:jmap_dart_client/jmap/account_id.dart';
@@ -185,6 +186,7 @@ void main() {
setUp(() {
Get.locale = locale;
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
});
group('accept test:', () {
@@ -270,9 +272,18 @@ void main() {
verify(rejectCalendarEventInteractor.execute(testAccountId, {blobId}, emailId, locale.languageCode)).called(1);
});
});
tearDown(() {
debugDefaultTargetPlatformOverride = null;
});
});
group('StoreEventAttendanceStatusInteractor test', () {
setUp(() {
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
});
group('calendarEventSuccess method test', () {
test(
'SHOULD call execute on StoreEventAttendanceStatusInteractor\n'
@@ -343,5 +354,9 @@ void main() {
)).called(1);
});
});
tearDown(() {
debugDefaultTargetPlatformOverride = null;
});
});
}
@@ -4,6 +4,7 @@ import 'package:core/presentation/state/failure.dart';
import 'package:core/presentation/state/success.dart';
import 'package:core/presentation/utils/app_toast.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/utils/application_manager.dart';
import 'package:dartz/dartz.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:get/get.dart';
@@ -51,6 +52,7 @@ import 'home_controller_test.mocks.dart';
MockSpec<UpdateAuthenticationAccountInteractor>(),
MockSpec<CachingManager>(),
MockSpec<LanguageCacheManager>(),
MockSpec<ApplicationManager>(),
])
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
@@ -77,6 +79,7 @@ void main() {
late MockImagePaths mockImagePaths;
late MockResponsiveUtils mockResponsiveUtils;
late MockUuid mockUuid;
late MockApplicationManager mockApplicationManager;
setUpAll(() {
cleanupEmailCacheInteractor = MockCleanupEmailCacheInteractor();
@@ -102,6 +105,7 @@ void main() {
mockImagePaths = MockImagePaths();
mockResponsiveUtils = MockResponsiveUtils();
mockUuid = MockUuid();
mockApplicationManager = MockApplicationManager();
Get.put<GetSessionInteractor>(mockGetSessionInteractor);
Get.put<GetAuthenticatedAccountInteractor>(mockGetAuthenticatedAccountInteractor);
@@ -122,6 +126,7 @@ void main() {
Get.put<ImagePaths>(mockImagePaths);
Get.put<ResponsiveUtils>(mockResponsiveUtils);
Get.put<Uuid>(mockUuid);
Get.put<ApplicationManager>(mockApplicationManager);
Get.testMode = true;
homeController = HomeController(
@@ -3,6 +3,7 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart';
import 'package:core/presentation/resources/image_paths.dart';
import 'package:core/presentation/utils/app_toast.dart';
import 'package:core/presentation/utils/responsive_utils.dart';
import 'package:core/utils/application_manager.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:get/get.dart';
import 'package:mockito/annotations.dart';
@@ -65,6 +66,7 @@ import 'login_controller_test.mocks.dart';
MockSpec<UpdateAuthenticationAccountInteractor>(),
MockSpec<CachingManager>(),
MockSpec<LanguageCacheManager>(),
MockSpec<ApplicationManager>(),
])
void main() {
late MockAuthenticationInteractor mockAuthenticationInteractor;
@@ -94,6 +96,7 @@ void main() {
late MockImagePaths mockImagePaths;
late MockResponsiveUtils mockResponsiveUtils;
late MockUuid mockUuid;
late MockApplicationManager mockApplicationManager;
late LoginController loginController;
@@ -130,6 +133,7 @@ void main() {
mockImagePaths = MockImagePaths();
mockResponsiveUtils = MockResponsiveUtils();
mockUuid = MockUuid();
mockApplicationManager = MockApplicationManager();
Get.put<GetSessionInteractor>(mockGetSessionInteractor);
Get.put<GetAuthenticatedAccountInteractor>(mockGetAuthenticatedAccountInteractor);
@@ -149,6 +153,7 @@ void main() {
Get.put<ImagePaths>(mockImagePaths);
Get.put<ResponsiveUtils>(mockResponsiveUtils);
Get.put<Uuid>(mockUuid);
Get.put<ApplicationManager>(mockApplicationManager);
Get.testMode = true;
loginController = LoginController(
@@ -17,7 +17,6 @@ import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:model/mailbox/presentation_mailbox.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:rxdart/subjects.dart';
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
import 'package:tmail_ui_user/features/composer/domain/usecases/send_email_interactor.dart';
@@ -168,6 +167,8 @@ const fallbackGenerators = {
MockSpec<CachingManager>(),
MockSpec<LanguageCacheManager>(),
MockSpec<RemoveComposerCacheOnWebInteractor>(),
MockSpec<ApplicationManager>(),
MockSpec<GetAllIdentitiesInteractor>(),
])
void main() {
// mock mailbox dashboard controller direct dependencies
@@ -303,12 +304,6 @@ void main() {
Get.put<RemoveComposerCacheOnWebInteractor>(removeComposerCacheOnWebInteractor);
Get.testMode = true;
PackageInfo.setMockInitialValues(
appName: '',
packageName: '',
version: '',
buildNumber: '',
buildSignature: '');
when(emailReceiveManager.pendingEmailAddressInfo).thenAnswer((_) => BehaviorSubject.seeded(null));
when(emailReceiveManager.pendingEmailContentInfo).thenAnswer((_) => BehaviorSubject.seeded(null));