From 65f25f840eae66da45ebfb65354d1fe3e0299e26 Mon Sep 17 00:00:00 2001 From: Dhanji Prasanna Date: Fri, 24 Oct 2025 16:11:24 +1100 Subject: [PATCH] test --- crates/g3-core/src/take_screenshot_test.rs | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 crates/g3-core/src/take_screenshot_test.rs diff --git a/crates/g3-core/src/take_screenshot_test.rs b/crates/g3-core/src/take_screenshot_test.rs new file mode 100644 index 0000000..a90d81e --- /dev/null +++ b/crates/g3-core/src/take_screenshot_test.rs @@ -0,0 +1,37 @@ +// Test to verify take_screenshot requires window_id + +#[cfg(test)] +mod take_screenshot_tests { + use super::*; + use serde_json::json; + + #[test] + fn test_take_screenshot_requires_window_id() { + // Create a tool call without window_id + let tool_call = ToolCall { + tool: "take_screenshot".to_string(), + args: json!({ + "path": "test.png" + }), + }; + + // Verify that window_id is missing + assert!(tool_call.args.get("window_id").is_none()); + } + + #[test] + fn test_take_screenshot_with_window_id() { + // Create a tool call with window_id + let tool_call = ToolCall { + tool: "take_screenshot".to_string(), + args: json!({ + "path": "test.png", + "window_id": "Safari" + }), + }; + + // Verify that window_id is present + assert!(tool_call.args.get("window_id").is_some()); + assert_eq!(tool_call.args.get("window_id").unwrap().as_str().unwrap(), "Safari"); + } +}