aboutsummaryrefslogtreecommitdiff
path: root/src/api/schema/tests.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-07-15 03:58:07 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-15 04:02:14 +0300
commit2c7c8beb079c5fd58a2e53efd2058df050ad9f55 (patch)
tree6756f671dc728d915b1d6ebececa8cf7f70b66fb /src/api/schema/tests.rs
parent88370e1516182ab519d22a12fa82d5780a40fee6 (diff)
feat: add floating popup panes
refs #1125
Diffstat (limited to 'src/api/schema/tests.rs')
-rw-r--r--src/api/schema/tests.rs26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs
index adc7e61c..bc044ee9 100644
--- a/src/api/schema/tests.rs
+++ b/src/api/schema/tests.rs
@@ -814,6 +814,8 @@ fn plugin_link_list_unlink_round_trip() {
description: None,
platforms: None,
placement: PluginPanePlacement::Overlay,
+ width: None,
+ height: None,
command: vec!["bun".into(), "run".into(), "board.ts".into()],
}],
link_handlers: vec![PluginManifestLinkHandler {
@@ -1152,10 +1154,12 @@ fn plugin_pane_open_request_round_trips() {
method: Method::PluginPaneOpen(PluginPaneOpenParams {
plugin_id: "example.board".into(),
entrypoint: "board".into(),
- placement: Some(PluginPanePlacement::Zoomed),
+ placement: Some(PluginPanePlacement::Popup),
+ width: Some(crate::popup_size::PopupSize::Cells(90)),
+ height: Some(crate::popup_size::PopupSize::Percent(80)),
workspace_id: None,
- target_pane_id: Some("1-1".into()),
- direction: Some(SplitDirection::Right),
+ target_pane_id: None,
+ direction: None,
cwd: Some("/tmp".into()),
focus: true,
env: [("HERDR_ROLE".to_string(), "board".to_string())].into(),
@@ -1164,7 +1168,23 @@ fn plugin_pane_open_request_round_trips() {
let json = serde_json::to_value(&request).unwrap();
assert_eq!(json["method"], "plugin.pane.open");
+ assert_eq!(json["params"]["placement"], "popup");
+ assert_eq!(json["params"]["width"], 90);
+ assert_eq!(json["params"]["height"], "80%");
assert_eq!(json["params"]["env"]["HERDR_ROLE"], "board");
let restored: Request = serde_json::from_value(json).unwrap();
assert_eq!(restored, request);
}
+
+#[test]
+fn popup_close_request_round_trips() {
+ let request = Request {
+ id: "popup-close".into(),
+ method: Method::PopupClose(EmptyParams::default()),
+ };
+
+ let json = serde_json::to_value(request).unwrap();
+
+ assert_eq!(json["method"], "popup.close");
+ assert_eq!(json["params"], serde_json::json!({}));
+}