diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-04 15:31:14 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-04 16:51:10 +0300 |
| commit | 15cab964f3494b77159caaea289e17e1596e0720 (patch) | |
| tree | d9614056c26b0d148771a464fc2eb0f0cabc60a2 /src/api/schema/tests.rs | |
| parent | b78a8a5c565e66e7e5ba9a06d9cb7f3a771fc4b0 (diff) | |
feat: emit layout update events for runtime layout changes
Diffstat (limited to 'src/api/schema/tests.rs')
| -rw-r--r-- | src/api/schema/tests.rs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs index 5106fafe..abd96656 100644 --- a/src/api/schema/tests.rs +++ b/src/api/schema/tests.rs @@ -374,6 +374,34 @@ fn event_envelope_round_trips() { tabs: vec![], }, }, + EventEnvelope { + event: EventKind::LayoutUpdated, + data: EventData::LayoutUpdated { + layout: PaneLayoutSnapshot { + workspace_id: "w_1".into(), + tab_id: "w_1:1".into(), + zoomed: false, + area: PaneLayoutRect { + x: 0, + y: 0, + width: 100, + height: 24, + }, + focused_pane_id: "w_1-1".into(), + panes: vec![PaneLayoutPane { + pane_id: "w_1-1".into(), + focused: true, + rect: PaneLayoutRect { + x: 0, + y: 0, + width: 100, + height: 24, + }, + }], + splits: vec![], + }, + }, + }, ]; for event in events { @@ -934,12 +962,17 @@ fn authority_mutation_requests_round_trip() { let subscription = Request { id: "sub_moves".into(), method: Method::EventsSubscribe(EventsSubscribeParams { - subscriptions: vec![Subscription::WorkspaceMoved {}, Subscription::TabMoved {}], + subscriptions: vec![ + Subscription::WorkspaceMoved {}, + Subscription::TabMoved {}, + Subscription::LayoutUpdated {}, + ], }), }; let json = serde_json::to_string(&subscription).unwrap(); assert!(json.contains("\"type\":\"workspace.moved\"")); assert!(json.contains("\"type\":\"tab.moved\"")); + assert!(json.contains("\"type\":\"layout.updated\"")); let restored: Request = serde_json::from_str(&json).unwrap(); assert_eq!(restored, subscription); } |
