diff --git a/crates/ui-egui/src/dialogs/new_document.rs b/crates/ui-egui/src/dialogs/new_document.rs index 22842c599b..e90bf7e09e 100644 --- a/crates/ui-egui/src/dialogs/new_document.rs +++ b/crates/ui-egui/src/dialogs/new_document.rs @@ -1047,16 +1047,16 @@ mod tests { }) } - /// The dialog reads rows as `file.new` does: a whole number from 1 to the artboard limit, - /// `4.0` included, and a fractional, zero or larger count is refused with nothing changed. + /// The dialog reads rows as `file.new` does: rounded to a whole number from 1 to the artboard + /// limit, and a count that rounds to 0 or is larger is refused with nothing changed. #[test] fn the_dialog_reads_rows_as_file_new_does() { let mut app = app(); open(&mut app); set(&app, "artboards", json!(5)).unwrap(); - set(&app, "artboardLayout", json!({"layout": "gridByColumn", "rows": 4.0})).unwrap(); + set(&app, "artboardLayout", json!({"layout": "gridByColumn", "rows": 3.6})).unwrap(); assert_eq!(fields(&app)["artboardLayout"]["rows"], json!(4)); - for rows in [json!(3.5), json!(MAX_ARTBOARDS + 1), json!(0)] { + for rows in [json!(0.4), json!(MAX_ARTBOARDS + 1), json!(0)] { let e = set(&app, "artboardLayout", json!({"layout": "gridByColumn", "rows": rows})).unwrap_err(); assert!(e.contains("can't take"), "{rows}: {e}"); assert_eq!(fields(&app)["artboardLayout"]["rows"], json!(4), "{rows}");