diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-07-26 02:45:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-26 02:45:44 +0300 |
| commit | 8843bbb0c4dc4e6b52ca5d0a6592ce80be56a19c (patch) | |
| tree | 9387a75a8ae34fd864de83355412331c4f22a2b9 /src/api/schema/tests.rs | |
| parent | 547aba8e0ab310623f1986d3026658f708d432bd (diff) | |
fix: improve sidebar worktree hierarchy and reordering (#1873)
* fix: clarify sidebar worktree hierarchy
refs #1694
* feat: reorder worktree groups as a unit
refs #1694
Diffstat (limited to 'src/api/schema/tests.rs')
| -rw-r--r-- | src/api/schema/tests.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs index 9fcc03b0..16894dbf 100644 --- a/src/api/schema/tests.rs +++ b/src/api/schema/tests.rs @@ -470,6 +470,14 @@ fn event_envelope_round_trips() { }, }, EventEnvelope { + event: EventKind::WorkspaceReordered, + data: EventData::WorkspaceReordered { + workspace_ids: vec!["w_1".into(), "w_2".into()], + before_workspace_id: Some("w_3".into()), + workspaces: vec![], + }, + }, + EventEnvelope { event: EventKind::TabMoved, data: EventData::TabMoved { tab_id: "w_1:1".into(), @@ -1063,6 +1071,18 @@ fn authority_mutation_requests_round_trip() { let restored: Request = serde_json::from_value(json).unwrap(); assert_eq!(restored, workspace_move); + let workspace_move_block = Request { + id: "move_ws_block".into(), + method: Method::WorkspaceMoveBlock(WorkspaceMoveBlockParams { + workspace_ids: vec!["w1".into(), "w2".into()], + before_workspace_id: Some("w3".into()), + }), + }; + let json = serde_json::to_value(&workspace_move_block).unwrap(); + assert_eq!(json["method"], "workspace.move_block"); + let restored: Request = serde_json::from_value(json).unwrap(); + assert_eq!(restored, workspace_move_block); + let tab_move = Request { id: "move_tab".into(), method: Method::TabMove(TabMoveParams { @@ -1105,6 +1125,7 @@ fn authority_mutation_requests_round_trip() { method: Method::EventsSubscribe(EventsSubscribeParams { subscriptions: vec![ Subscription::WorkspaceMoved {}, + Subscription::WorkspaceReordered {}, Subscription::TabMoved {}, Subscription::LayoutUpdated {}, ], @@ -1112,6 +1133,7 @@ fn authority_mutation_requests_round_trip() { }; let json = serde_json::to_string(&subscription).unwrap(); assert!(json.contains("\"type\":\"workspace.moved\"")); + assert!(json.contains("\"type\":\"workspace.reordered\"")); assert!(json.contains("\"type\":\"tab.moved\"")); assert!(json.contains("\"type\":\"layout.updated\"")); let restored: Request = serde_json::from_str(&json).unwrap(); |
