diff --git a/crates/engine/tests/it/table_resize_overlap.rs b/crates/engine/tests/it/table_resize_overlap.rs index 7bdae2ebb..ee7f2bdce 100644 --- a/crates/engine/tests/it/table_resize_overlap.rs +++ b/crates/engine/tests/it/table_resize_overlap.rs @@ -196,14 +196,17 @@ fn resizing_a_table_without_a_header_row_keeps_its_names_and_data() { #[test] fn resized_formula_header_is_named_by_its_value_when_formulas_show() { + // The formula goes in D1, not next to the table, so entering it doesn't grow the table and + // the header is named by Resize Table itself. let mut s = with_headers("A1:B3", &["x", "y"]); - s.execute("cell.set", json!({"cell": "C1", "input": "=1+1"})).unwrap(); + s.execute("cell.set", json!({"cell": "D1", "input": "=1+1"})).unwrap(); + assert_eq!(sheet(&s).tables[0].range.a1(), "A1:B3"); { let wb = std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().wb); std::sync::Arc::make_mut(&mut wb.sheets[0]).show_formulas = true; } - s.execute("table.resize", json!({"table": "T", "range": "A1:C3"})).unwrap(); - assert_eq!(names(&s, 0), ["x", "y", "2"]); + s.execute("table.resize", json!({"table": "T", "range": "A1:D3"})).unwrap(); + assert_eq!(names(&s, 0).last().map(String::as_str), Some("2")); assert_eq!(headers(&s, 0), names(&s, 0)); }