TF-2737 Separate PDF view handler between each browser

This commit is contained in:
DatDang
2024-03-21 17:46:22 +07:00
committed by Dat H. Pham
parent 6ccdbd66c4
commit 754987b59e
4 changed files with 262 additions and 35 deletions
@@ -178,7 +178,10 @@ void main() {
'when attachment mime type is pdf',
() async {
// arrange
final testAttachment = Attachment(type: MediaType('application', 'pdf'));
const attachmentName = 'test_name.pdf';
final testAttachment = Attachment(
type: MediaType('application', 'pdf'),
name: attachmentName);
when(mailboxDashboardController.sessionCurrent).thenReturn(testSession);
when(viewAttachmentForWebInteractor.execute(
testDownloadTaskId,
@@ -201,10 +204,11 @@ void main() {
await untilCalled(mailboxDashboardController.deleteDownloadTask(any));
verify(mailboxDashboardController.deleteDownloadTask(testDownloadTaskId))
.called(1);
await untilCalled(downloadManager.openDownloadedFileWeb(any, any));
await untilCalled(downloadManager.openDownloadedFileWeb(any, any, any));
verify(downloadManager.openDownloadedFileWeb(
testBytes,
Constant.pdfMimeType,
attachmentName,
)).called(1);
},
);