mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-12-03 02:37:06 +03:00
keep Manual selected when switching to it from Disabled or Auto
Choosing Manual after an unsaved Disabled or Auto sent `""`, which counts as no change, so BaseSection reset the form to the saved value and the field snapped back to the saved option. Manual now stays selected when the form falls back to the saved value, and it starts from the saved manual args when there are any, otherwise from an empty box.
This commit is contained in:
@@ -158,6 +158,47 @@ test.describe("hwaccel args widget @medium", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("Preset then Disabled then Manual stays on Manual", async ({
|
||||
frigateApp,
|
||||
}) => {
|
||||
await openSettings(frigateApp, "/settings?page=globalFfmpeg");
|
||||
|
||||
await radio(frigateApp, "root_hwaccel_args", "disabled").click();
|
||||
const manual = radio(frigateApp, "root_hwaccel_args", "manual");
|
||||
await manual.click();
|
||||
|
||||
await expect(manual).toBeChecked();
|
||||
await expect(manualInput(frigateApp)).toHaveValue("");
|
||||
});
|
||||
|
||||
test("Auto then Manual starts with an empty box", async ({ frigateApp }) => {
|
||||
await openSettings(frigateApp, "/settings?page=globalFfmpeg");
|
||||
|
||||
await radio(frigateApp, "root_hwaccel_args", "auto").click();
|
||||
const manual = radio(frigateApp, "root_hwaccel_args", "manual");
|
||||
await manual.click();
|
||||
|
||||
await expect(manual).toBeChecked();
|
||||
await expect(manualInput(frigateApp)).toHaveValue("");
|
||||
});
|
||||
|
||||
test("switching back to Manual shows the saved manual args", async ({
|
||||
frigateApp,
|
||||
}) => {
|
||||
await openSettings(frigateApp, "/settings?page=globalFfmpeg", {
|
||||
ffmpeg: { hwaccel_args: "-hwaccel vaapi" },
|
||||
});
|
||||
|
||||
const manual = radio(frigateApp, "root_hwaccel_args", "manual");
|
||||
for (const from of ["preset", "disabled", "auto"]) {
|
||||
await radio(frigateApp, "root_hwaccel_args", from).click();
|
||||
await manual.click();
|
||||
|
||||
await expect(manual).toBeChecked();
|
||||
await expect(manualInput(frigateApp)).toHaveValue("-hwaccel vaapi");
|
||||
}
|
||||
});
|
||||
|
||||
test("Disabled keeps the side-by-side layout", async ({ frigateApp }) => {
|
||||
test.skip(frigateApp.isMobile, "the layout stacks on narrow screens");
|
||||
await openSettings(frigateApp, "/settings?page=globalFfmpeg");
|
||||
|
||||
Reference in New Issue
Block a user