aboutsummaryrefslogtreecommitdiff
path: root/tests/api_ping.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-23 15:11:48 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-23 15:19:36 +0300
commit9817820af1f0468402934122538f658299ff71de (patch)
tree1bf668cf866213d10eec30a85401aedc54fb714f /tests/api_ping.rs
parented11779fcaebea7cc3223c4e221ea43674057891 (diff)
feat: add worktree cli and socket api
Diffstat (limited to 'tests/api_ping.rs')
-rw-r--r--tests/api_ping.rs20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/api_ping.rs b/tests/api_ping.rs
index a8012ea6..b1468ae4 100644
--- a/tests/api_ping.rs
+++ b/tests/api_ping.rs
@@ -227,7 +227,7 @@ fn ping_over_socket_returns_version() {
assert_eq!(value["result"]["version"], env!("CARGO_PKG_VERSION"));
// Intentionally hardcoded so wire protocol bumps require updating this test.
// Changing this value means old clients/servers are no longer compatible.
- assert_eq!(value["result"]["protocol"], 9);
+ assert_eq!(value["result"]["protocol"], 10);
cleanup_spawned_herdr(child, base);
}
@@ -1073,7 +1073,7 @@ fn events_subscribe_streams_tab_and_workspace_close_events() {
let mut reader = open_subscription(
&socket_path,
- r#"{"id":"sub_life_c","method":"events.subscribe","params":{"subscriptions":[{"type":"tab.closed"},{"type":"workspace.closed"}]}}"#,
+ r#"{"id":"sub_life_c","method":"events.subscribe","params":{"subscriptions":[{"type":"workspace.renamed"},{"type":"tab.closed"},{"type":"workspace.closed"}]}}"#,
);
let ack = reader.read_json_line(Duration::from_secs(2));
@@ -1092,10 +1092,24 @@ fn events_subscribe_streams_tab_and_workspace_close_events() {
let tab_closed = wait_for_event(&mut reader, "tab_closed", Duration::from_secs(2));
assert_eq!(tab_closed["data"]["tab_id"], second_tab_id);
+ let renamed_ws = send_request(
+ &socket_path,
+ &format!(
+ r#"{{"id":"req_tc_4","method":"workspace.rename","params":{{"workspace_id":"{}","label":"renamed"}}}}"#,
+ workspace_id
+ ),
+ );
+ assert_eq!(renamed_ws["result"]["workspace"]["label"], "renamed");
+
+ let workspace_renamed =
+ wait_for_event(&mut reader, "workspace_renamed", Duration::from_secs(2));
+ assert_eq!(workspace_renamed["data"]["workspace_id"], workspace_id);
+ assert_eq!(workspace_renamed["data"]["label"], "renamed");
+
let closed_ws = send_request(
&socket_path,
&format!(
- r#"{{"id":"req_tc_4","method":"workspace.close","params":{{"workspace_id":"{}"}}}}"#,
+ r#"{{"id":"req_tc_5","method":"workspace.close","params":{{"workspace_id":"{}"}}}}"#,
workspace_id
),
);