diff --git a/tests/sanity/tests/chat/chat.spec.ts b/tests/sanity/tests/chat/chat.spec.ts index 0ba12e2987..f0e91a6851 100644 --- a/tests/sanity/tests/chat/chat.spec.ts +++ b/tests/sanity/tests/chat/chat.spec.ts @@ -281,7 +281,7 @@ test.describe('channel tests', () => { await channelPage.checkIfMessageExist(true, 'Test message') }) - test('check if user can pin message', async () => { + test('check if user can reply message', async () => { await leftSideMenuPage.clickChunter() await channelPage.clickChannel('random') await channelPage.sendMessage('Test message') @@ -291,6 +291,40 @@ test.describe('channel tests', () => { await channelPage.checkIfMessageExist(true, 'Reply message') }) + test('check if user can pin message', async () => { + await leftSideMenuPage.clickChunter() + await channelPage.clickChannel('random') + await channelPage.sendMessage('Test message') + await channelPage.pinMessage('Test message') + await channelPage.clickPinMessageButton() + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.clickPinMessageButton() + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.clickPinMessageButton() + await channelPage.checkIfMessageExist(true, 'Test message') + }) + + test('check if user can unpin message on pinned messages page', async () => { + await leftSideMenuPage.clickChunter() + await channelPage.clickChannel('random') + await channelPage.sendMessage('Test message') + await channelPage.pinMessage('Test message') + await channelPage.clickPinMessageButton() + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.unpinMessage('Test message') + await channelPage.checkIfMessageExist(false, 'Test message') + }) + + test('check if user can unpin message messages page', async () => { + await leftSideMenuPage.clickChunter() + await channelPage.clickChannel('random') + await channelPage.sendMessage('Test message') + await channelPage.pinMessage('Test message') + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.unpinMessage('Test message') + await channelPage.checkIfMessageExist(false, 'Test message') + }) + test('check if user can edit message', async ({ page }) => { await leftSideMenuPage.clickChunter() await channelPage.clickChannel('random') diff --git a/tests/sanity/tests/model/channel-page.ts b/tests/sanity/tests/model/channel-page.ts index d4c898ea3d..dd9016b6d9 100644 --- a/tests/sanity/tests/model/channel-page.ts +++ b/tests/sanity/tests/model/channel-page.ts @@ -115,6 +115,10 @@ export class ChannelPage extends CommonPage { await this.saveMessageTab().click() } + async clickPinMessageButton(): Promise { + await this.pinnedMessageButton().click() + } + async addMemberToChannelPreview (user: string): Promise { await this.addMemberPreview().click() await this.addMemberToChannelButton(user).click() @@ -182,6 +186,13 @@ export class ChannelPage extends CommonPage { await expect(this.pinnedMessage(message)).toBeVisible() } + async unpinMessage (message: string): Promise { + await this.textMessage(message).hover() + await this.pinMessageButton().click() + await this.pinnedMessageButton().click() + await expect(this.pinnedMessage(message)).not.toBeVisible() + } + async replyToMessage (message: string, messageReply: string): Promise { await this.textMessage(message).hover() await this.replyButton().click()