-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Mark as unread not working (#32939)
Co-authored-by: Douglas Fabris <[email protected]>
- Loading branch information
Showing
9 changed files
with
125 additions
and
9 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": patch | ||
--- | ||
|
||
Fixed issue where when you marked a room as unread and you were part of it, sometimes it would mark it as read right after |
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
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,71 @@ | ||
import { createAuxContext } from './fixtures/createAuxContext'; | ||
import { Users } from './fixtures/userStates'; | ||
import { HomeChannel } from './page-objects'; | ||
import { createTargetChannel } from './utils'; | ||
import { test, expect } from './utils/test'; | ||
|
||
test.use({ storageState: Users.admin.state }); | ||
|
||
test.describe.serial('mark-unread', () => { | ||
let poHomeChannel: HomeChannel; | ||
let targetChannel: string; | ||
|
||
test.beforeEach(async ({ page, api }) => { | ||
poHomeChannel = new HomeChannel(page); | ||
targetChannel = await createTargetChannel(api, { members: ['user2'] }); | ||
|
||
await page.emulateMedia({ reducedMotion: 'reduce' }); | ||
await page.goto('/home'); | ||
}); | ||
|
||
test.afterEach(async ({ api }) => { | ||
await api.post('/channels.delete', { roomName: targetChannel }); | ||
}); | ||
|
||
test.describe('Mark Unread - Sidebar Action', () => { | ||
test('should not mark empty room as unread', async () => { | ||
await poHomeChannel.sidenav.selectMarkAsUnread(targetChannel); | ||
|
||
await expect(poHomeChannel.sidenav.getRoomBadge(targetChannel)).not.toBeVisible(); | ||
}); | ||
|
||
test('should mark a populated room as unread', async () => { | ||
await poHomeChannel.sidenav.openChat(targetChannel); | ||
await poHomeChannel.content.sendMessage('this is a message for reply'); | ||
await poHomeChannel.sidenav.selectMarkAsUnread(targetChannel); | ||
|
||
await expect(poHomeChannel.sidenav.getRoomBadge(targetChannel)).toBeVisible(); | ||
}); | ||
|
||
test('should mark a populated room as unread - search', async () => { | ||
await poHomeChannel.sidenav.openChat(targetChannel); | ||
await poHomeChannel.content.sendMessage('this is a message for reply'); | ||
await poHomeChannel.sidenav.selectMarkAsUnread(targetChannel); | ||
await poHomeChannel.sidenav.searchRoom(targetChannel); | ||
|
||
await expect(poHomeChannel.sidenav.getSearchChannelBadge(targetChannel)).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('Mark Unread - Message Action', () => { | ||
let poHomeChannelUser2: HomeChannel; | ||
|
||
test('should mark a populated room as unread', async ({ browser }) => { | ||
const { page: user2Page } = await createAuxContext(browser, Users.user2); | ||
poHomeChannelUser2 = new HomeChannel(user2Page); | ||
|
||
await poHomeChannelUser2.sidenav.openChat(targetChannel); | ||
await poHomeChannelUser2.content.sendMessage('this is a message for reply'); | ||
await user2Page.close(); | ||
|
||
await poHomeChannel.sidenav.openChat(targetChannel); | ||
|
||
// wait for the sidebar item to be read | ||
await poHomeChannel.sidenav.getSidebarItemByName(targetChannel, true).waitFor(); | ||
await poHomeChannel.content.openLastMessageMenu(); | ||
await poHomeChannel.markUnread.click(); | ||
|
||
await expect(poHomeChannel.sidenav.getRoomBadge(targetChannel)).toBeVisible(); | ||
}); | ||
}); | ||
}); |
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