Fix E2E tests

This commit is contained in:
Kalle 2025-12-18 21:00:52 +02:00
parent fe1c9a336d
commit 8871b54783
3 changed files with 14 additions and 7 deletions

View File

@ -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;
}

View File

@ -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 (
<CastInfoWrapper
submitButtonText="Lock to be casted"

View File

@ -66,7 +66,8 @@ test.describe("LFG", () => {
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 }) => {