Skip to content

Commit

Permalink
test: fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Dec 20, 2024
1 parent 33dbac1 commit 45a4559
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ export class HomeFlextabRoom {
return this.page.locator('role=button[name="More"]');
}

get btnLeave(): Locator {
return this.roomInfoTab.locator('role=button[name="Leave"]');
}

get btnDelete(): Locator {
return this.roomInfoTab.locator('role=button[name="Delete"]');
}

getMoreOption(option: string) {
return this.roomInfoTab.locator(`role=menuitem[name="${option}"]`);
}
Expand Down
10 changes: 6 additions & 4 deletions apps/meteor/tests/e2e/team-management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ test.describe.serial('teams-management', () => {
test('should delete targetTeamNonPrivate', async () => {
await poHomeTeam.sidenav.openChat(targetTeamNonPrivate);
await poHomeTeam.tabs.btnRoomInfo.click();
await poHomeTeam.tabs.room.btnDelete.click();
await poHomeTeam.tabs.room.btnMore.click();
await poHomeTeam.tabs.room.getMoreOption('Delete').click();
await expect(poHomeTeam.tabs.room.confirmDeleteTeamModal).toBeVisible();

await poHomeTeam.tabs.room.confirmDeleteTeam();
Expand All @@ -393,7 +394,8 @@ test.describe.serial('teams-management', () => {
await user1Channel.content.waitForChannel();

await user1Channel.tabs.btnRoomInfo.click();
await user1Channel.tabs.room.btnLeave.click();
await poHomeTeam.tabs.room.btnMore.click();
await poHomeTeam.tabs.room.getMoreOption('Leave').click();
await expect(user1Channel.tabs.room.confirmLeaveModal).toBeVisible();

await user1Channel.tabs.room.confirmLeave();
Expand All @@ -406,11 +408,11 @@ test.describe.serial('teams-management', () => {
await expect(poHomeTeam.tabs.members.memberOption('user1')).not.toBeVisible();
});

test('should convert team into a channel', async ({ page }) => {
test('should convert team into a channel', async () => {
await poHomeTeam.sidenav.openChat(targetTeam);
await poHomeTeam.tabs.btnRoomInfo.click();
await poHomeTeam.tabs.room.btnMore.click();
await page.getByRole('listbox', { exact: true }).getByRole('option', { name: 'Convert to Channel' }).click();
await poHomeTeam.tabs.room.getMoreOption('Convert to Channel').click();
await expect(poHomeTeam.tabs.room.confirmConvertModal).toBeVisible();

await poHomeTeam.tabs.room.confirmConvert();
Expand Down

0 comments on commit 45a4559

Please sign in to comment.