diff --git a/app/features/tournament-lfg/components/LFGGroupCard.tsx b/app/features/tournament-lfg/components/LFGGroupCard.tsx index 71331b0ea..fe2c4a261 100644 --- a/app/features/tournament-lfg/components/LFGGroupCard.tsx +++ b/app/features/tournament-lfg/components/LFGGroupCard.tsx @@ -310,6 +310,7 @@ function LFGStayAsSubSwitch({ isStayAsSub }: { isStayAsSub: boolean }) { return ( submit("SET_STAY_AS_SUB", { stayAsSub })} > diff --git a/e2e/pages/tournament/tournament-looking-page.ts b/e2e/pages/tournament/tournament-looking-page.ts index ae8ff3243..a1b4f7cf8 100644 --- a/e2e/pages/tournament/tournament-looking-page.ts +++ b/e2e/pages/tournament/tournament-looking-page.ts @@ -7,14 +7,16 @@ import { createFormHelpers } from "../../helpers/playwright-form"; /** `/to/:id/looking` — the groups view shown while registration is still open. */ export class TournamentLookingPage { private readonly page: Page; + private readonly stayAsSubSwitchLabel; readonly joinQueueForm; readonly locators; constructor(page: Page) { this.page = page; this.joinQueueForm = createFormHelpers(page, joinQueueFormSchema); + this.stayAsSubSwitchLabel = page.getByTestId("stay-as-sub-switch"); this.locators = { - stayAsSubSwitch: page.getByRole("switch", { name: "Stay as sub" }), + stayAsSubSwitch: this.stayAsSubSwitchLabel.getByRole("switch"), }; } @@ -25,7 +27,7 @@ export class TournamentLookingPage { toggleStayAsSub() { return waitForPOSTResponse(this.page, () => // the switch input itself is visually hidden behind its indicator - this.locators.stayAsSubSwitch.click({ force: true }), + this.stayAsSubSwitchLabel.click(), ); } }