mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 23:27:55 -05:00
Default added VoD games to Splat Zones
This commit is contained in:
@@ -177,6 +177,19 @@ describe("VodForm", () => {
|
||||
expect(fieldsets.length).toBe(2);
|
||||
});
|
||||
|
||||
test("added match defaults to Splat Zones", async () => {
|
||||
const screen = await renderForm();
|
||||
|
||||
const addButton = screen.getByRole("button", { name: "Add" });
|
||||
await userEvent.click(addButton.element());
|
||||
|
||||
const addedFieldset = screen.container.querySelectorAll("fieldset")[1];
|
||||
const checkedMode = addedFieldset.querySelector<HTMLInputElement>(
|
||||
'input[type="radio"]:checked',
|
||||
);
|
||||
expect(checkedMode?.value).toBe("SZ");
|
||||
});
|
||||
|
||||
test("can remove matches when more than 1", async () => {
|
||||
const screen = await renderForm({
|
||||
defaultValues: {
|
||||
|
||||
@@ -123,6 +123,7 @@ const matchFieldsetSchema = v.object({
|
||||
label: `modes.${mode}` as const,
|
||||
value: mode,
|
||||
})),
|
||||
initialValue: "SZ",
|
||||
}),
|
||||
stageId: stageSelect({ label: "labels.vodStage" }),
|
||||
weapon: weaponSelectOptional({ label: "labels.vodWeapon" }),
|
||||
|
||||
@@ -565,7 +565,10 @@ export function radioGroup<V extends string>(
|
||||
Omit<FormFieldInputGroup<"radio-group", V>, "type" | "initialValue">,
|
||||
V
|
||||
>
|
||||
>,
|
||||
> & {
|
||||
/** Value selected when the form has no default value for the field. Defaults to the first item. */
|
||||
initialValue?: V;
|
||||
},
|
||||
): v.GenericSchema<ItemValue<V>, ItemValue<V>> {
|
||||
return register(itemsSchema(args.items), {
|
||||
...args,
|
||||
@@ -573,7 +576,7 @@ export function radioGroup<V extends string>(
|
||||
bottomText: prefixKey(args.bottomText),
|
||||
items: prefixItems(args.items),
|
||||
type: "radio-group",
|
||||
initialValue: args.items[0].value,
|
||||
initialValue: args.initialValue ?? args.items[0].value,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
5
changelog/2026-09-29-vod-new-game-splat-zones.md
Normal file
5
changelog/2026-09-29-vod-new-game-splat-zones.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
navItem: vods
|
||||
type: bug
|
||||
---
|
||||
Games added to a VoD now default to Splat Zones like the first game
|
||||
Reference in New Issue
Block a user