Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

rustfmt

moppeeer5677b4021cbd
diff --git a/crates/ui-egui/src/panels/properties/tests.rs b/crates/ui-egui/src/panels/properties/tests.rs
index e2ebf6feb..ea3c385bc 100644
--- a/crates/ui-egui/src/panels/properties/tests.rs
+++ b/crates/ui-egui/src/panels/properties/tests.rs
@@ -786,33 +786,33 @@ fn apply_to_text_colours_a_text_frames_text_not_the_frame() {
assert_eq!(doc.item(designcraft_doc::ids::ItemId(id)).unwrap().fill.swatch, "[None]", "the frame isn't");
}
- #[test]
- fn apply_to_text_colours_the_text_of_several_text_frames() {
- let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
- app.run("file.new", json!({})).unwrap();
- let mut ids = vec![];
- let mut stories = vec![];
- for x in [72, 250, 430] {
- let r = app.run("frame.create", json!({"rect": [x, 72, x + 150, 140], "content": "text", "text": "75%"})).unwrap();
- ids.push(r["id"].as_u64().unwrap());
- stories.push(designcraft_doc::StoryId(r["story"].as_u64().unwrap()));
- }
- app.run("selection.set", json!({"ids": ids})).unwrap();
- let mut h = panel(app);
- h.get_by_label("Fill swatch").click();
- h.run_steps(3);
- // Three text frames, as one: Apply To is offered.
- assert!(h.query_by_label("Apply To:").is_some());
- h.get_by_label("Text").click();
- h.run_steps(3);
- h.get_by_label(CYAN).click();
- h.run_steps(3);
- let doc = &h.state().session.active().unwrap().doc;
- for (id, story) in ids.iter().zip(&stories) {
- assert_eq!(doc.story(*story).unwrap().char_format_at(0).over.fill.as_deref(), Some(CYAN), "every frame's text is cyan");
- assert_eq!(doc.item(designcraft_doc::ids::ItemId(*id)).unwrap().fill.swatch, "[None]", "the frames aren't");
- }
+#[test]
+fn apply_to_text_colours_the_text_of_several_text_frames() {
+ let mut app = DesignApp::new(designcraft_engine::Session::new(), crate::Services::default());
+ app.run("file.new", json!({})).unwrap();
+ let mut ids = vec![];
+ let mut stories = vec![];
+ for x in [72, 250, 430] {
+ let r = app.run("frame.create", json!({"rect": [x, 72, x + 150, 140], "content": "text", "text": "75%"})).unwrap();
+ ids.push(r["id"].as_u64().unwrap());
+ stories.push(designcraft_doc::StoryId(r["story"].as_u64().unwrap()));
}
+ app.run("selection.set", json!({"ids": ids})).unwrap();
+ let mut h = panel(app);
+ h.get_by_label("Fill swatch").click();
+ h.run_steps(3);
+ // Three text frames, as one: Apply To is offered.
+ assert!(h.query_by_label("Apply To:").is_some());
+ h.get_by_label("Text").click();
+ h.run_steps(3);
+ h.get_by_label(CYAN).click();
+ h.run_steps(3);
+ let doc = &h.state().session.active().unwrap().doc;
+ for (id, story) in ids.iter().zip(&stories) {
+ assert_eq!(doc.story(*story).unwrap().char_format_at(0).over.fill.as_deref(), Some(CYAN), "every frame's text is cyan");
+ assert_eq!(doc.item(designcraft_doc::ids::ItemId(*id)).unwrap().fill.swatch, "[None]", "the frames aren't");
+ }
+}
#[test]
fn transform_flips_and_rotates_from_properties() {