mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-10 22:12:49 +00:00
feat(automation): advertise file.open in automation.version capabilities
This commit is contained in:
@@ -195,7 +195,8 @@ nlohmann::json JsonRpcDispatcher::m_version(const nlohmann::json&) {
|
||||
{"protocol", "2.0"},
|
||||
{"capabilities", nlohmann::json::array({
|
||||
"tree.dump","tree.find","widget.get","input.click","input.type",
|
||||
"input.key","sync.wait_for","app.state","screenshot.window" })} };
|
||||
"input.key","sync.wait_for","app.state","screenshot.window",
|
||||
"file.open" })} };
|
||||
}
|
||||
|
||||
nlohmann::json JsonRpcDispatcher::dispatch(const nlohmann::json& request) {
|
||||
|
||||
@@ -257,3 +257,13 @@ TEST_CASE("file.open backend load failure -> 1007", "[automation][rpc]") {
|
||||
{"params",{{"paths","C:/abs/a.stl"}}}});
|
||||
CHECK(resp.at("error").at("code") == kErrLoadFailed);
|
||||
}
|
||||
|
||||
TEST_CASE("automation.version capabilities include file.open", "[automation][rpc]") {
|
||||
MockUiBackend mock;
|
||||
JsonRpcDispatcher d(mock);
|
||||
const json resp = d.dispatch({{"jsonrpc","2.0"},{"id",1},{"method","automation.version"}});
|
||||
const auto& caps = resp.at("result").at("capabilities");
|
||||
bool found = false;
|
||||
for (const auto& c : caps) if (c == "file.open") found = true;
|
||||
CHECK(found);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user