Skip to content

Commit

Permalink
test: fix flaky unread collapser
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Nov 22, 2024
1 parent 66b5913 commit c1160fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions apps/meteor/tests/e2e/feature-preview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,9 @@ test.describe.serial('feature preview', () => {
const item = poHomeChannel.sidebar.getSearchRoomByName(targetChannel);
await poHomeChannel.sidebar.markItemAsUnread(item);
await poHomeChannel.sidebar.escSearch();
await poHomeChannel.sidebar.getCollapseGroupByName('Channels').click();

await expect(async () => {
const collapser = poHomeChannel.sidebar.getCollapseGroupByName('Channels');
await collapser.click();

await expect(poHomeChannel.sidebar.getItemUnreadBadge(collapser)).toBeVisible();
}).toPass();
await expect(poHomeChannel.sidebar.getItemUnreadBadge(poHomeChannel.sidebar.getCollapseGroupByName('Channels', false))).toBeVisible();
});
});

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/tests/e2e/page-objects/fragments/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export class Sidebar {
await this.page.getByRole('option', { name: 'Mark Unread' }).click();
}

getCollapseGroupByName(name: string): Locator {
return this.channelsList.getByRole('button', { name, exact: true });
getCollapseGroupByName(name: string, exact?: boolean): Locator {
return this.channelsList.getByRole('button', { name, exact });
}

getItemUnreadBadge(item: Locator): Locator {
Expand Down

0 comments on commit c1160fe

Please sign in to comment.