Fix org ban without expiry (#2776)

This commit is contained in:
Kalle
2026-01-25 21:21:09 +02:00
committed by GitHub
parent e7feef15af
commit 832cd0b8f1
2 changed files with 23 additions and 1 deletions

View File

@@ -433,7 +433,7 @@ export function datetimeOptional(args: DateTimeArgs) {
maxDate,
args.maxMessage ? { message: `forms:${args.maxMessage}` } : undefined,
)
.optional(),
.nullish(),
)
.register(formRegistry, {
...args,

View File

@@ -171,6 +171,28 @@ test.describe("Tournament Organization", () => {
await page.getByRole("button", { name: "Save" }).click();
await expect(page.getByText("Teams (1)")).toBeVisible();
// 5. As admin, ban user again but with permanent ban this time
await impersonate(page, ADMIN_ID);
await navigate({ page, url });
await bannedUsersTab.click();
await page.getByText("New ban", { exact: true }).click();
const dialog2 = page.getByRole("dialog");
await expect(dialog2).toBeVisible();
const userSearchCombobox2 = dialog2.getByRole("button").filter({
has: page.locator('[class*="selectValue"]'),
});
await userSearchCombobox2.click();
await expect(page.getByTestId("user-search-input")).toBeVisible();
await page.getByTestId("user-search-input").fill("N-ZAP");
await expect(page.getByTestId("user-search-item").first()).toBeVisible();
await page.keyboard.press("Enter");
const banForm2 = createFormHelpers(page, banUserActionSchema);
await banForm2.fill("privateNote", "Does not expire");
// Don't set expiresAt - leave empty for permanent ban
await submit(page);
// Verify "Permanent" appears in the table
await expect(page.getByRole("table")).toContainText("Permanent");
});
test("allows member of established org to create tournament", async ({