From 17a1e27048fd1f2250302d43e38eb2ea44d829ac Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 6 Sep 2026 16:57:18 +0300 Subject: [PATCH] Fix E2E test --- app/features/tournament-lfg/components/LFGGroupCard.tsx | 1 + e2e/pages/tournament/tournament-looking-page.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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(), ); } }