mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-22 18:22:24 +00:00
Integration: keytip NR test gives the sheet data so the Insert Chart dialog opens
This commit is contained in:
1 parent
818175f51e
commit
c4c7f747c7
2 files changed
+7
-1
No files matched your search
@@ -1283,6 +1283,12 @@ fn keytip_nq_() {
|
||||
#[test]
|
||||
fn keytip_nr_() {
|
||||
let mut h = harness(blank());
|
||||
// The dialog previews chart types for the selected data, so the sheet needs some.
|
||||
h.state_mut()
|
||||
.session
|
||||
.execute("range.setValues", serde_json::json!({"range": "A1", "values": [["Fruit", "Sales"], ["Apples", 5], ["Pears", 3]]}))
|
||||
.unwrap();
|
||||
h.state_mut().session.execute("selection.set", serde_json::json!({"range": "A1:B3"})).unwrap();
|
||||
sequence(&mut h, "NR", false);
|
||||
assert_eq!(h.state().dialog.as_ref().map(|d| d.name.as_str()), Some("recommendedCharts"), "NR must open the recommendedCharts dialog");
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ fn render_tests(entries: &[Entry], probe: &Probe) -> String {
|
||||
"command" if UI_DIALOG_COMMANDS.iter().any(|(c, _)| *c == e.target) => {
|
||||
let dialog = UI_DIALOG_COMMANDS.iter().find(|(c, _)| *c == e.target).map_or("", |(_, d)| d);
|
||||
format!(
|
||||
"sequence(&mut h, {seq:?}, false);\n assert_eq!(h.state().dialog.as_ref().map(|d| d.name.as_str()), Some({dialog:?}), \"{seq} must open the {dialog} dialog\");",
|
||||
"// The dialog previews chart types for the selected data, so the sheet needs some.\n h.state_mut().session.execute(\"range.setValues\", serde_json::json!({{\"range\": \"A1\", \"values\": [[\"Fruit\", \"Sales\"], [\"Apples\", 5], [\"Pears\", 3]]}})).unwrap();\n h.state_mut().session.execute(\"selection.set\", serde_json::json!({{\"range\": \"A1:B3\"}})).unwrap();\n sequence(&mut h, {seq:?}, false);\n assert_eq!(h.state().dialog.as_ref().map(|d| d.name.as_str()), Some({dialog:?}), \"{seq} must open the {dialog} dialog\");",
|
||||
seq = e.seq,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user