diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index ac9183c3..f70213ae 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -5702,3 +5702,21 @@ fn exporting_a_slide_again_overwrites_the_png_with_the_edit() { let second = std::fs::read(&png).unwrap(); assert_ne!(first, second, "the second export replaced the file with the edited slide"); } + +#[test] +fn action_button_fill_follows_the_theme() { + let mut s = session(); + let id = s.execute("insert.actionButton", &json!({"kind": "next"})).unwrap()["id"].clone(); + let fill = |s: &mut Session| { + let r = s.execute("slide.inspect", &json!({})).unwrap(); + r["shapes"].as_array().unwrap().iter().find(|x| x["id"] == id).unwrap()["fill"].clone() + }; + let before = fill(&mut s); + assert!(before.as_str().is_some_and(|f| f.starts_with('#')), "{before}"); + s.execute("design.theme", &json!({"name": "Ember"})).unwrap(); + let after = fill(&mut s); + assert_ne!(before, after, "the button takes the new theme's accent1"); + let st = s.doc().unwrap(); + let sh = st.doc.slides[0].shapes.iter().find(|x| x.fill.is_none() && x.style.is_some()).unwrap(); + assert!(sh.fill.is_none(), "no explicit fill: the style binds it to accent1"); +}