Objects: main's chart data table compiles with the object selection and the model's object test

Two leftovers of the merge of origin/main (25881a8e), neither a textual
conflict: `Chart` gained a `data_table` field, which the `push_object`
helper of the model's object test did not set (it is `None`, as in
`insert.chart`); and chart_data_table.rs set the `selected_chart` field
this branch replaced by `selected_object`. The test selects its chart as
a floating object, as the branch's other tests do.
This commit is contained in:
prxnvt
2026-11-02 01:57:49 -05:00
parent 082e379412
commit 21a27a76be
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -718,6 +718,7 @@ mod tests {
series: vec![],
legend: LegendPos::default(),
data_labels: false,
data_table: None,
gridlines: false,
style: 0,
x_title: None,
+2 -1
View File
@@ -1,6 +1,7 @@
use egui::accesskit::Role;
use egui_kittest::kittest::Queryable;
use gridcraft_engine::Session;
use gridcraft_engine::model::{ObjKind, ObjRef};
use serde_json::json;
#[test]
@@ -10,7 +11,7 @@ fn format_chart_pane_controls_the_engine_data_table() {
session.execute("range.setValues", json!({"range": "A1", "values": [["Quarter", "North", "South"], ["Q1", 10, 30], ["Q2", 30, 10]]})).unwrap();
let id = session.execute("insert.chart", json!({"range": "A1:C3", "type": "column", "at": "E3"})).unwrap()["chart"].as_u64().unwrap() as u32;
let mut h = crate::support::harness(session, 4);
h.state_mut().selected_chart = Some(id);
h.state_mut().selected_object = Some(ObjRef::new(ObjKind::Chart, id));
h.state_mut().grid.pane = Some("formatChart".into());
h.run_steps(2);
h.get_by_role_and_label(Role::DisclosureTriangle, "Data Table").click();