aboutsummaryrefslogtreecommitdiff
path: root/src/api/schema/tests.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-01 15:48:22 +0300
committerGitHub <noreply@github.com>2026-09-01 15:48:22 +0300
commit207be3c771d281baae6e5fa0fb74be9a056e97a2 (patch)
treed7b037ecdf629224a048c841d11659efdc23507d /src/api/schema/tests.rs
parent8a6d697308162874a236c84aac0b0f8c7ac01f83 (diff)
refactor: render the shell in the client (#3487)
* feat: add opt-in client-rendered shell * feat: add client-owned shell mouse controls * feat: complete client-owned shell chrome * feat: add client-owned shell settings and notifications * feat: run client shell custom commands * feat: render popup terminals in client shell * feat: add client-owned scrollback and copy mode * fix: preserve client worktree trust defaults * feat: render startup diagnostics in client shell * feat: render onboarding in client shell * feat: render product announcements in client shell * feat: render release notes in client shell * feat: render mobile switcher in client shell * feat: render kitty graphics in client shell * fix: preserve client shell lifecycle coherence * refactor: route client shell commands through endpoint connections * refactor: make the client-rendered shell the default * refactor: remove monolithic launch mode * refactor: complete client-rendered shell cutover * perf: retain client pane surface updates * perf: scale retained pane surface updates * perf: remove remote pane input latency * test: make client shell checks platform-independent * fix: prevent client timer starvation * test: fix client shell platform gates * test: accept retained surfaces in cross-area checks * test: make client mode assertions platform-neutral * fix: badge only outdated integrations
Diffstat (limited to 'src/api/schema/tests.rs')
-rw-r--r--src/api/schema/tests.rs75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs
index 663f3fc4..e4a7f2a3 100644
--- a/src/api/schema/tests.rs
+++ b/src/api/schema/tests.rs
@@ -50,6 +50,7 @@ fn request_uses_dot_method_names() {
let request = Request {
id: "req_1".into(),
method: Method::WorkspaceCreate(WorkspaceCreateParams {
+ source_workspace_id: None,
cwd: Some("/tmp".into()),
focus: true,
label: Some("api".into()),
@@ -273,6 +274,54 @@ fn request_round_trips_for_agent_explain() {
}
#[test]
+fn integration_list_request_and_response_round_trip() {
+ let request = Request {
+ id: "req_integrations".into(),
+ method: Method::IntegrationList(EmptyParams::default()),
+ };
+ let json = serde_json::to_value(&request).unwrap();
+ assert_eq!(json["method"], "integration.list");
+ assert_eq!(serde_json::from_value::<Request>(json).unwrap(), request);
+
+ let response = SuccessResponse {
+ id: "req_integrations".into(),
+ result: ResponseResult::IntegrationList {
+ integrations: vec![IntegrationInfo {
+ target: IntegrationTarget::Codex,
+ label: "codex".into(),
+ command: "codex".into(),
+ available: true,
+ state: IntegrationState::Outdated,
+ }],
+ },
+ };
+ let json = serde_json::to_value(&response).unwrap();
+ assert_eq!(json["result"]["type"], "integration_list");
+ assert_eq!(json["result"]["integrations"][0]["state"], "outdated");
+ assert_eq!(
+ serde_json::from_value::<SuccessResponse>(json).unwrap(),
+ response
+ );
+}
+
+#[test]
+fn command_invoke_request_round_trips_without_command_text() {
+ let request = Request {
+ id: "req_command".into(),
+ method: Method::CommandInvoke(CommandInvokeParams {
+ command_id: "cmd_0123456789abcdef0123456789abcdef".into(),
+ workspace_id: Some("w1".into()),
+ tab_id: Some("w1:t1".into()),
+ pane_id: Some("w1:p1".into()),
+ selection: None,
+ }),
+ };
+ let json = serde_json::to_value(&request).unwrap();
+ assert_eq!(json["method"], "command.invoke");
+ assert_eq!(serde_json::from_value::<Request>(json).unwrap(), request);
+}
+
+#[test]
fn notification_show_request_parses() {
let json = r#"{"id":"req_1","method":"notification.show","params":{"title":"build failed","body":"api workspace","position":"top-left","sound":"request"}}"#;
let request: Request = serde_json::from_str(json).unwrap();
@@ -1264,6 +1313,32 @@ fn event_wait_parses_typed_match() {
}
#[test]
+fn pane_link_activate_round_trips() {
+ let request = Request {
+ id: "req_pane_link".into(),
+ method: Method::PaneLinkActivate(PaneLinkActivateParams {
+ pane_id: "w1:p1".into(),
+ viewport_row: 3,
+ col: 7,
+ content_revision: Some(42),
+ offset_from_bottom: Some(5),
+ }),
+ };
+ let json = serde_json::to_value(&request).unwrap();
+ assert_eq!(json["method"], "pane.link.activate");
+ let restored: Request = serde_json::from_value(json).unwrap();
+ assert_eq!(restored, request);
+
+ let response = ResponseResult::PaneLinkActivated {
+ url: Some("https://example.test".into()),
+ handled: false,
+ };
+ let json = serde_json::to_string(&response).unwrap();
+ let restored: ResponseResult = serde_json::from_str(&json).unwrap();
+ assert_eq!(restored, response);
+}
+
+#[test]
fn plugin_action_list_and_invoke_round_trips() {
let list = Request {
id: "req_plugin_action_list".into(),