mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-31 22:16:59 -06:00
Merge PR #553 from NikitkaRa: Text: Bullets and Numbering dialog
# Conflicts: # crates/engine/src/tests.rs
This commit is contained in:
@@ -1546,3 +1546,23 @@ fn motion_path_presets_have_paths_ids_and_round_trip() {
|
||||
assert_eq!((b.effect.as_str(), b.class), ("heart", AnimClass::Path));
|
||||
assert!(b.path.as_deref().is_some_and(|p| p.contains('L')));
|
||||
}
|
||||
|
||||
/// Bullets and Numbering dialog: numbering takes a colour and a size like bullets do, and sizes
|
||||
/// stay within PowerPoint's 25–400 %.
|
||||
#[test]
|
||||
fn numbering_takes_color_and_size() {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("insert.textBox", &json!({"rect": [10, 10, 300, 100], "text": "One\nTwo"})).unwrap();
|
||||
s.execute("format.numbering", &json!({"on": true, "scheme": "romanUcPeriod", "start": 3, "color": "accent2", "size": 150})).unwrap();
|
||||
let para = |s: &Session| {
|
||||
let st = s.doc().unwrap();
|
||||
let id = st.selection.shapes[0];
|
||||
st.shape(id).unwrap().text.as_ref().unwrap().paragraphs[0].props.clone()
|
||||
};
|
||||
let pp = para(&s);
|
||||
assert!(matches!(&pp.bullet, Some(deckcraft_model::text::Bullet::AutoNum { scheme, start_at: 3 }) if scheme == "romanUcPeriod"));
|
||||
assert_eq!(pp.bullet_size, Some(1.5));
|
||||
assert_eq!(pp.bullet_color, Some(deckcraft_model::ColorRef::scheme(deckcraft_color::SchemeSlot::Accent2)));
|
||||
s.execute("format.bullets", &json!({"on": true, "char": "★", "size": 9000})).unwrap();
|
||||
assert_eq!(para(&s).bullet_size, Some(4.0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user