Integration: #1676 the Insert Table limits test uses the limits, not sizes above them

Main refuses a size outside the limits instead of clamping it, so the test inserts the largest table and checks one step over each limit is refused.
This commit is contained in:
aiongg committed 2026-10-31 01:02:16 +00:00
1 parent 9ff71e1d0a
commit baf6e1b85e
1 file changed
+4 -1
+4 -1
View File
@@ -503,7 +503,10 @@ fn insert_table_with_a_style_is_one_step() {
assert!(s.execute("table.insert", &json!({"tableStyle": bad})).is_err(), "{bad}");
}
assert!(s.doc().unwrap().doc.story(designcraft_doc::StoryId(sid)).unwrap().tables.is_empty());
let r = s.execute("table.insert", &json!({"rows": 900, "cols": 300, "headerRows": 150, "tableStyle": "Grid"})).unwrap();
for over in [json!({"rows": 501}), json!({"cols": 201}), json!({"headerRows": 101})] {
assert!(s.execute("table.insert", &over).is_err(), "{over}");
}
let r = s.execute("table.insert", &json!({"rows": 500, "cols": 200, "headerRows": 100, "tableStyle": "Grid"})).unwrap();
let t = s.execute("table.get", &json!({"table": r["table"]})).unwrap();
assert_eq!(t["style"], "Grid");
let n = |k: &str| t[k].as_array().unwrap().len() as u64;