TF-3894 Fix blank email content when opening email
This commit is contained in:
@@ -61,6 +61,7 @@ void main() {
|
||||
when(mockCreateEmailRequest.session).thenReturn(mockSession);
|
||||
when(mockCreateEmailRequest.identity).thenReturn(mockIdentity);
|
||||
when(mockCreateEmailRequest.replyToRecipients).thenReturn({});
|
||||
when(mockCreateEmailRequest.ownEmailAddress).thenReturn('test@example.com');
|
||||
|
||||
repository = ComposerRepositoryImpl(
|
||||
mockAttachmentUploadDataSource,
|
||||
|
||||
+7
@@ -4,6 +4,7 @@ import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:model/extensions/session_extension.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/repository/composer_repository.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/create_new_and_save_email_to_drafts_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/create_email_request.dart';
|
||||
@@ -41,6 +42,9 @@ void main() {
|
||||
session: SessionFixtures.aliceSession,
|
||||
accountId: AccountFixtures.aliceAccountId,
|
||||
emailActionType: EmailActionType.editDraft,
|
||||
ownEmailAddress: SessionFixtures
|
||||
.aliceSession
|
||||
.getOwnEmailAddressOrEmpty(),
|
||||
subject: 'subject',
|
||||
emailContent: 'emailContent',
|
||||
draftsEmailId: EmailId(Id('some-id'))
|
||||
@@ -81,6 +85,9 @@ void main() {
|
||||
session: SessionFixtures.aliceSession,
|
||||
accountId: AccountFixtures.aliceAccountId,
|
||||
emailActionType: EmailActionType.editDraft,
|
||||
ownEmailAddress: SessionFixtures
|
||||
.aliceSession
|
||||
.getOwnEmailAddressOrEmpty(),
|
||||
subject: 'subject',
|
||||
emailContent: 'emailContent',
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:model/extensions/session_extension.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/repository/composer_repository.dart';
|
||||
import 'package:tmail_ui_user/features/composer/domain/usecases/create_new_and_send_email_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/model/create_email_request.dart';
|
||||
@@ -32,6 +33,9 @@ void main() {
|
||||
session: SessionFixtures.aliceSession,
|
||||
accountId: AccountFixtures.aliceAccountId,
|
||||
emailActionType: EmailActionType.editDraft,
|
||||
ownEmailAddress: SessionFixtures
|
||||
.aliceSession
|
||||
.getOwnEmailAddressOrEmpty(),
|
||||
subject: 'subject',
|
||||
emailContent: 'emailContent',
|
||||
);
|
||||
|
||||
@@ -22,6 +22,7 @@ import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:model/email/attachment.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
import 'package:model/extensions/session_extension.dart';
|
||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
import 'package:rich_text_composer/rich_text_composer.dart';
|
||||
import 'package:tmail_ui_user/features/base/before_reconnect_manager.dart';
|
||||
@@ -106,6 +107,9 @@ class MockMailboxDashBoardController extends Mock implements MailboxDashBoardCon
|
||||
@override
|
||||
Session? get sessionCurrent => SessionFixtures.aliceSession;
|
||||
|
||||
@override
|
||||
RxString get ownEmailAddress => SessionFixtures.aliceSession.getOwnEmailAddressOrEmpty().obs;
|
||||
|
||||
@override
|
||||
Rxn<DraggableAppState> get attachmentDraggableAppState => Rxn(DraggableAppState.inActive);
|
||||
@override
|
||||
|
||||
+6
@@ -13,6 +13,9 @@ void main() {
|
||||
session: SessionFixtures.aliceSession,
|
||||
accountId: AccountFixtures.aliceAccountId,
|
||||
emailActionType: EmailActionType.editDraft,
|
||||
ownEmailAddress: SessionFixtures
|
||||
.aliceSession
|
||||
.getOwnEmailAddressOrEmpty(),
|
||||
subject: 'subject',
|
||||
emailContent: 'emailContent',
|
||||
);
|
||||
@@ -67,6 +70,9 @@ void main() {
|
||||
session: SessionFixtures.aliceSession,
|
||||
accountId: AccountFixtures.aliceAccountId,
|
||||
emailActionType: EmailActionType.editDraft,
|
||||
ownEmailAddress: SessionFixtures
|
||||
.aliceSession
|
||||
.getOwnEmailAddressOrEmpty(),
|
||||
subject: 'subject',
|
||||
emailContent: 'emailContent',
|
||||
hasRequestReadReceipt: true,
|
||||
|
||||
@@ -196,6 +196,7 @@ void main() {
|
||||
{},
|
||||
{accountId: account},
|
||||
{}, UserName('value'), Uri(), Uri(), Uri(), Uri(), State('value'));
|
||||
String ownEmailAddress = 'user@example.com';
|
||||
|
||||
test(
|
||||
'should call deletePublicAssetsInteractor.execute() '
|
||||
@@ -213,7 +214,11 @@ void main() {
|
||||
{},
|
||||
{accountId: account},
|
||||
{}, UserName('value'), Uri(), Uri(), Uri(), Uri(), State('value'));
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(accountId, session);
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(
|
||||
accountId,
|
||||
session,
|
||||
ownEmailAddress,
|
||||
);
|
||||
|
||||
// act
|
||||
identityCreatorController.onReady();
|
||||
@@ -242,7 +247,11 @@ void main() {
|
||||
'and user has not picked any image',
|
||||
() {
|
||||
// arrange
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(accountId, session);
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(
|
||||
accountId,
|
||||
session,
|
||||
ownEmailAddress,
|
||||
);
|
||||
|
||||
// act
|
||||
identityCreatorController.onReady();
|
||||
@@ -272,7 +281,11 @@ void main() {
|
||||
PlatformInfo.isTestingForWeb = true;
|
||||
const htmlContent = '<p>test</p>';
|
||||
const identityName = 'test';
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(accountId, session);
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(
|
||||
accountId,
|
||||
session,
|
||||
ownEmailAddress,
|
||||
);
|
||||
when(mockVerifyNameInteractor.execute(any, any)).thenAnswer((_) => Right(VerifyNameViewState()));
|
||||
|
||||
// act
|
||||
@@ -322,7 +335,11 @@ void main() {
|
||||
PlatformInfo.isTestingForWeb = true;
|
||||
const htmlContent = '<p>test</p>';
|
||||
const identityName = 'test';
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(accountId, session);
|
||||
identityCreatorController.arguments = IdentityCreatorArguments(
|
||||
accountId,
|
||||
session,
|
||||
ownEmailAddress,
|
||||
);
|
||||
when(mockVerifyNameInteractor.execute(any, any)).thenAnswer((_) => Right(VerifyNameViewState()));
|
||||
|
||||
// act
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@ void main() {
|
||||
.thenAnswer((_) => Stream.value(Right(GetAllIdentitiesSuccess(
|
||||
[identity1, identity2, identity3, identity4],
|
||||
null))));
|
||||
when(mockManageAccountDashBoardController.ownEmailAddress).thenReturn(Rx(''));
|
||||
when(mockManageAccountDashBoardController.ownEmailAddress).thenReturn(RxString(''));
|
||||
when(mockManageAccountDashBoardController.accountId).thenReturn(Rxn());
|
||||
when(mockManageAccountDashBoardController.sessionCurrent).thenReturn(SessionFixtures.aliceSession);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user