forked from 1b-agent/opencadstudio-upstream
Merge pull request #1690 from YsDirector/pr/d6-external-change-actions
Expose external-change modal actions to automation
This commit is contained in:
commit
8d98608d1a
3 files changed
+46
-1
No files matched your search
@@ -1874,6 +1874,30 @@ mod tests {
|
||||
stale["request_id"] = json!("stale");
|
||||
assert_eq!(app.control_request(stale).0["code"], "stale_state");
|
||||
}
|
||||
#[test]
|
||||
fn external_change_modal_actions_are_automatable() {
|
||||
let mut app = OpenCADStudio::new_for_test();
|
||||
let names = crate::app::automation_action_names();
|
||||
for name in [
|
||||
"external_change_reload",
|
||||
"external_change_overwrite",
|
||||
"external_change_save_as",
|
||||
"external_change_cancel",
|
||||
] {
|
||||
assert!(names.contains(&name), "{name} should be listed");
|
||||
}
|
||||
// No conflict pending: the action is a harmless no-op, not an error.
|
||||
let reply = request(
|
||||
&mut app,
|
||||
json!({
|
||||
"op":"action",
|
||||
"request_id":"external-action-noop",
|
||||
"name":"external_change_reload"
|
||||
}),
|
||||
);
|
||||
assert_eq!(reply["status"], "completed", "{reply}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn control_errors_and_missing_entities_do_not_report_success() {
|
||||
let mut app = OpenCADStudio::new_for_test();
|
||||
|
||||
Reference in new issue
Block a user