Prevent unreg and kicking members in invitational tournaments

This commit is contained in:
Kalle
2026-08-29 19:46:06 +03:00
parent 5050b8d4fa
commit dfd84cf8f4
5 changed files with 33 additions and 22 deletions

View File

@@ -28,6 +28,8 @@ export class TournamentRegisterPage {
"Registration for this tournament has closed",
),
leaveTeamButton: page.getByRole("button", { name: "Leave the team" }),
deleteMemberButton: page.getByRole("button", { name: "Delete member" }),
unregisterButton: page.getByRole("button", { name: "Unregister" }),
organizerAddedLeaveExplanation: page.getByText(
"You were added to the team by the organizer. Contact the TO to leave the team.",
),

View File

@@ -85,6 +85,13 @@ test.describe("Invitational tournament", () => {
await expect(
register.locators.organizerAddedLeaveExplanation,
).toBeVisible();
// nor can the captain kick them, the organizer owns the roster
await impersonate(page, captain.id);
await register.goto(tournament.id);
await expect(register.member(2)).toBeVisible();
await expect(register.locators.deleteMemberButton).toHaveCount(0);
await expect(register.locators.unregisterButton).toHaveCount(0);
});
});