TF-4392 [Team Mailbox] Auto save draft email team mailbox when edit

This commit is contained in:
dab246
2026-03-30 16:16:29 +07:00
committed by Dat H. Pham
parent 9feef8da99
commit beb323874b
7 changed files with 53 additions and 31 deletions
@@ -66,34 +66,25 @@ void main() {
);
test(
'SHOULD return default trash id with null path '
'WHEN selectedMailbox is personal',
'SHOULD return team trash id '
'WHEN emailMailbox is team mailbox even if selectedMailbox is personal',
() {
when(mockDashBoardController.selectedMailbox)
.thenReturn(Rxn(personalMailbox));
when(mockDashBoardController.findDefaultMailboxIdInTeamMailbox(
namespace: teamNamespace,
mailboxName: PresentationMailbox.trashRole,
)).thenReturn(teamTrashId);
when(mockDashBoardController.getTeamMailboxNodePathWithSeparator(
mailboxId: teamTrashId,
)).thenReturn('Team/Trash');
final result = mockDashBoardController.getTrashMailboxIdAndPath(
teamMailbox,
);
expect(result.trashId, equals(defaultTrashId));
expect(result.trashPath, isNull);
},
);
test(
'SHOULD use selectedMailbox over emailMailbox '
'WHEN selectedMailbox is not null',
() {
when(mockDashBoardController.selectedMailbox)
.thenReturn(Rxn(personalMailbox));
final result = mockDashBoardController.getTrashMailboxIdAndPath(
teamMailbox,
);
expect(result.trashId, equals(defaultTrashId));
expect(result.trashPath, isNull);
expect(result.trashId, equals(teamTrashId));
expect(result.trashPath, equals('Team/Trash'));
},
);