From 8871b547830e00f3983f1365788006e2116aa5da Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 18 Dec 2025 21:00:52 +0200 Subject: [PATCH] Fix E2E tests --- .../actions/to.$id.matches.$mid.server.ts | 7 +++++-- app/features/tournament-bracket/components/CastInfo.tsx | 8 ++++++-- e2e/lfg.spec.ts | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts b/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts index 34aed6a2b..b5bcceb17 100644 --- a/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts +++ b/app/features/tournament-bracket/actions/to.$id.matches.$mid.server.ts @@ -557,8 +557,11 @@ export const action: ActionFunction = async ({ params, request }) => { "Not an organizer or streamer", ); - // can't lock if match status is not Locked (team(s) busy with previous match), let's update their view to reflect that - if (match.status !== TournamentMatchStatus.Locked) { + // can't lock if match status is not Locked or Waiting (team(s) busy with previous match), let's update their view to reflect that + if ( + match.status !== TournamentMatchStatus.Locked && + match.status !== TournamentMatchStatus.Waiting + ) { return null; } diff --git a/app/features/tournament-bracket/components/CastInfo.tsx b/app/features/tournament-bracket/components/CastInfo.tsx index 0c1d67048..9356b89b9 100644 --- a/app/features/tournament-bracket/components/CastInfo.tsx +++ b/app/features/tournament-bracket/components/CastInfo.tsx @@ -37,8 +37,12 @@ export function CastInfo({ if (castTwitchAccounts.length === 0 || !hasPerms || matchIsOver) return null; - // match can only be locked when status is Locked (team(s) busy with previous match) - if (matchStatus === TournamentMatchStatus.Locked && !isLocked) { + // match can only be locked when status is Locked or Waiting (team(s) busy with previous match) + if ( + (matchStatus === TournamentMatchStatus.Locked || + matchStatus === TournamentMatchStatus.Waiting) && + !isLocked + ) { return ( { await submit(page); - // wait for redirect to LFG page + // wait for redirect to LFG page & verify the language is displayed + await expect(page.getByText("DA / EN", { exact: true })).toBeVisible(); await expect(page.getByTestId("add-filter-button")).toBeVisible(); await expect( page.getByText("test post for language editing"), @@ -86,8 +87,7 @@ test.describe("LFG", () => { ).toBeVisible(); // verify updated language is displayed - await expect(page.getByText(/ES/)).toBeVisible(); - await expect(page.getByText(/DA/)).not.toBeVisible(); + await expect(page.getByText("EN / ES", { exact: true })).toBeVisible(); }); test("filters posts by language", async ({ page }) => {