You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Fix assertUnreadLessThan
and assertUnreadGreaterThan
(#12012)
This commit is contained in:
@ -470,7 +470,13 @@ class Helpers {
|
||||
*/
|
||||
async assertUnreadLessThan(room: string | { name: string }, lessThan: number) {
|
||||
const tile = this.getRoomListTile(room);
|
||||
expect(parseInt(await tile.locator(".mx_NotificationBadge_count").textContent(), 10)).toBeLessThan(lessThan);
|
||||
// https://playwright.dev/docs/test-assertions#expectpoll
|
||||
// .toBeLessThan doesn't have a retry mechanism, so we use .poll
|
||||
await expect
|
||||
.poll(async () => {
|
||||
return parseInt(await tile.locator(".mx_NotificationBadge_count").textContent(), 10);
|
||||
})
|
||||
.toBeLessThan(lessThan);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -482,9 +488,13 @@ class Helpers {
|
||||
*/
|
||||
async assertUnreadGreaterThan(room: string | { name: string }, greaterThan: number) {
|
||||
const tile = this.getRoomListTile(room);
|
||||
expect(parseInt(await tile.locator(".mx_NotificationBadge_count").textContent(), 10)).toBeGreaterThan(
|
||||
greaterThan,
|
||||
);
|
||||
// https://playwright.dev/docs/test-assertions#expectpoll
|
||||
// .toBeGreaterThan doesn't have a retry mechanism, so we use .poll
|
||||
await expect
|
||||
.poll(async () => {
|
||||
return parseInt(await tile.locator(".mx_NotificationBadge_count").textContent(), 10);
|
||||
})
|
||||
.toBeGreaterThan(greaterThan);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user