-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Disable OTR messages selection when exporting messages (#34220)
Co-authored-by: gabriellsh <[email protected]>
- Loading branch information
1 parent
24170d9
commit ff04c19
Showing
10 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
Disables OTR messages selection when exporting messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Users } from './fixtures/userStates'; | ||
import { HomeChannel } from './page-objects'; | ||
import { createDirectMessage } from './utils'; | ||
import { test, expect } from './utils/test'; | ||
|
||
test.use({ storageState: Users.admin.state }); | ||
|
||
test.describe.serial('OTR', () => { | ||
let poHomeChannel: HomeChannel; | ||
|
||
test.beforeEach(async ({ page, api }) => { | ||
await createDirectMessage(api); | ||
poHomeChannel = new HomeChannel(page); | ||
|
||
await page.goto('/home'); | ||
}); | ||
|
||
test('should not allow export OTR messages', async ({ browser }) => { | ||
const user1Page = await browser.newPage({ storageState: Users.user1.state }); | ||
const user1Channel = new HomeChannel(user1Page); | ||
|
||
await test.step('log in user1', async () => { | ||
await user1Page.goto(`/direct/${Users.admin.data.username}`); | ||
await user1Channel.content.waitForChannel(); | ||
}); | ||
|
||
await test.step('invite OTR with user1', async () => { | ||
await poHomeChannel.sidenav.openChat(Users.user1.data.username); | ||
await poHomeChannel.tabs.kebab.click({ force: true }); | ||
await poHomeChannel.tabs.btnEnableOTR.click({ force: true }); | ||
await poHomeChannel.tabs.otr.btnStartOTR.click(); | ||
}); | ||
|
||
await test.step('accept handshake with user1', async () => { | ||
await user1Channel.tabs.otr.btnAcceptOTR.click(); | ||
}); | ||
|
||
await poHomeChannel.content.sendMessage('hello OTR'); | ||
await poHomeChannel.tabs.kebab.click({ force: true }); | ||
await poHomeChannel.tabs.btnExportMessages.click(); | ||
await poHomeChannel.content.getMessageByText('hello OTR').click(); | ||
await expect(poHomeChannel.content.btnClearSelection).toBeDisabled(); | ||
|
||
await user1Page.close(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
apps/meteor/tests/e2e/page-objects/fragments/home-flextab-otr.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { Locator, Page } from '@playwright/test'; | ||
|
||
export class HomeFlextabOtr { | ||
private readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
get otrDialog(): Locator { | ||
return this.page.getByRole('dialog', { name: 'OTR' }); | ||
} | ||
|
||
get btnStartOTR(): Locator { | ||
return this.otrDialog.getByRole('button', { name: 'Start OTR' }); | ||
} | ||
|
||
get btnAcceptOTR(): Locator { | ||
return this.page.getByRole('dialog').getByRole('button', { name: 'Yes' }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters