From 52ba921651368e2195dcbcd705648d5d7cfb6001 Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 2 Nov 2026 08:29:56 +0100 Subject: [PATCH] Test: Photo Filter remembers Preserve Luminosity turned off photo_filter_opens_at_its_last_settings only confirmed a filter and density, so Preserve Luminosity kept its default (on) and a regression dropping it would still pass. It now turns Preserve Luminosity off, confirms, reopens and checks it stays off with the rest of the last settings (CodeRabbit review of #9970). Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/dialogs/adjust_dialog/tests.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs b/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs index 1f6090025c0..a06c1dc8002 100644 --- a/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs +++ b/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs @@ -959,6 +959,15 @@ fn photo_filter_opens_at_its_last_settings() { let again = open(&mut app, cmd).unwrap(); assert_eq!(crate::filter_dialog::params_of(&app.ui.dialog_mut(again).unwrap().fields.clone()), sample, "reopened at the last settings"); + // Preserve Luminosity is on by default; turned off and confirmed, it reopens off. + assert_eq!(neutral["preserveLuminosity"], json!(true)); + app.ui.dialog_mut(again).unwrap().fields.insert("preserveLuminosity".into(), json!(false)); + crate::dialogs::confirm(&mut app, again).unwrap(); + let again = open(&mut app, cmd).unwrap(); + let reopened = crate::filter_dialog::params_of(&app.ui.dialog_mut(again).unwrap().fields.clone()); + assert_eq!(reopened["preserveLuminosity"], json!(false), "Preserve Luminosity off is remembered"); + assert_eq!(reopened["color"], sample["color"], "with the rest of the last settings"); + assert_eq!(reopened["density"], sample["density"]); app.ui.dialogs.clear(); let smart = open_neutral(&mut app, cmd).unwrap(); assert_eq!(crate::filter_dialog::params_of(&app.ui.dialog_mut(smart).unwrap().fields.clone()), neutral, "open_neutral ignores them");