From 28bd4b42d00a68ec31d2c1f7ed1d5fe287f550d3 Mon Sep 17 00:00:00 2001 From: AlissonFA Date: Sun, 29 Nov 2026 07:18:32 -0300 Subject: [PATCH] #258: the formula-header Resize Table test enters its formula away from the table The test typed =1+1 next to the table's header row, which now grows the table and names the column itself, so table.resize had nothing left to do and the test no longer reached Resize Table's own header naming. The formula now goes in D1, two columns away, and the test checks the table did not grow before the resize. Co-Authored-By: Claude Opus 5.5 --- crates/engine/tests/it/table_resize_overlap.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)); }