mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-30 21:47:00 -06:00
[SS1] Pin that an inserted action button's fill follows the theme
It already does: insert.actionButton gives the shape the accent1 style with no explicit fill, as PowerPoint's gallery button has, so a theme change recolours it. No code change; a test pins it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
0efd6f1b85
commit
3356bc071c
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user