mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-08 03:22:59 +00:00
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:
1 parent
082e379412
commit
21a27a76be
2 files changed
+3
-1
No files matched your search
@@ -718,6 +718,7 @@ mod tests {
|
|||||||
series: vec![],
|
series: vec![],
|
||||||
legend: LegendPos::default(),
|
legend: LegendPos::default(),
|
||||||
data_labels: false,
|
data_labels: false,
|
||||||
|
data_table: None,
|
||||||
gridlines: false,
|
gridlines: false,
|
||||||
style: 0,
|
style: 0,
|
||||||
x_title: None,
|
x_title: None,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use egui::accesskit::Role;
|
use egui::accesskit::Role;
|
||||||
use egui_kittest::kittest::Queryable;
|
use egui_kittest::kittest::Queryable;
|
||||||
use gridcraft_engine::Session;
|
use gridcraft_engine::Session;
|
||||||
|
use gridcraft_engine::model::{ObjKind, ObjRef};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
#[test]
|
#[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();
|
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 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);
|
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.state_mut().grid.pane = Some("formatChart".into());
|
||||||
h.run_steps(2);
|
h.run_steps(2);
|
||||||
h.get_by_role_and_label(Role::DisclosureTriangle, "Data Table").click();
|
h.get_by_role_and_label(Role::DisclosureTriangle, "Data Table").click();
|
||||||
|
|||||||
Reference in new issue
Block a user