Skip to content

Commit

Permalink
fix: team-members.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ChmaraX authored and tatarco committed May 22, 2024
1 parent edaebca commit 5307f32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions apps/web/tests/page-models/teamMembersPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export class TeamMembersPage {
}

async assertNumberOfUsersInTeamMembersList(count: number) {
const memberRows = this.page.locator('/^member-row-.*$/');
await memberRows.count().then((rowCount) => {
expect(rowCount).toBe(count);
});
const memberRows = this.page.getByTestId(/^member-row-.*$/);
await expect(memberRows).toHaveCount(count);
}
}
3 changes: 1 addition & 2 deletions apps/web/tests/team-members.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ test.beforeEach(async ({ page }) => {

test('invite user by email', async ({ page }) => {
const teamMembersPage = await TeamMembersPage.goTo(page);
await waitForNetworkIdle(page);
await teamMembersPage.assertNumberOfUsersInTeamMembersList(1);
await teamMembersPage.inviteUserByEmail('test@test.com');
await teamMembersPage.assertNumberOfUsersInTeamMembersList(2);
});

test('remove user from team', async ({ page }) => {
const teamMembersPage = await TeamMembersPage.goTo(page);
await waitForNetworkIdle(page);
await teamMembersPage.inviteUserByEmail('test@test.com');

await teamMembersPage.assertNumberOfUsersInTeamMembersList(2);
await teamMembersPage.removeUserFromTeam();
await page.waitForTimeout(300);
Expand Down

0 comments on commit 5307f32

Please sign in to comment.