@@ -284,6 +284,34 @@ test.describe('basic features', () => {
284284 await expect ( exportMessagesTab . downloadFileMethod ) . toBeVisible ( ) ;
285285 await expect ( exportMessagesTab . sendEmailMethod ) . not . toBeVisible ( ) ;
286286 } ) ;
287+
288+ test ( 'should allow exporting messages as PDF in an encrypted room' , async ( { page } ) => {
289+ const sidenav = new HomeSidenav ( page ) ;
290+ const encryptedRoomPage = new EncryptedRoomPage ( page ) ;
291+ const exportMessagesTab = new HomeFlextabExportMessages ( page ) ;
292+
293+ const channelName = faker . string . uuid ( ) ;
294+
295+ await sidenav . createEncryptedChannel ( channelName ) ;
296+ await expect ( page ) . toHaveURL ( `/group/${ channelName } ` ) ;
297+ await expect ( encryptedRoomPage . encryptedRoomHeaderIcon ) . toBeVisible ( ) ;
298+
299+ await encryptedRoomPage . sendMessage ( 'This is a message to export as PDF.' ) ;
300+ await encryptedRoomPage . showExportMessagesTab ( ) ;
301+ await expect ( exportMessagesTab . downloadFileMethod ) . toBeVisible ( ) ;
302+
303+ // Select Output format as PDF
304+ await exportMessagesTab . outputFormat . click ( ) ;
305+ await exportMessagesTab . getMethodByName ( 'PDF' ) . click ( ) ;
306+
307+ // select messages to be exported
308+ await exportMessagesTab . btnSelectMessages . click ( ) ;
309+
310+ // Wait for download event and match format
311+ const [ download ] = await Promise . all ( [ page . waitForEvent ( 'download' ) , exportMessagesTab . btnDownloadExportMessages . click ( ) ] ) ;
312+ const suggestedFilename = download . suggestedFilename ( ) ;
313+ expect ( suggestedFilename ) . toMatch ( / \. p d f $ / ) ;
314+ } ) ;
287315} ) ;
288316
289317test . describe . serial ( 'e2e-encryption' , ( ) => {
0 commit comments