Skip to content

Commit 515e8c9

Browse files
author
Nitish [C] Dhok
committed
added two test cases for model and kiro-cki
1 parent ccb958b commit 515e8c9

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

e2etests/tests/kiro_cli_subcommand/test_kiro_cli_chat_subcommand.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,32 @@ fn test_kiro_cli_chat_subcommand() -> Result<(), Box<dyn std::error::Error>> {
2121

2222
println!("✅ kiro-cli chat subcommand executed successfully!");
2323

24+
Ok(())
25+
}
26+
27+
#[test]
28+
#[cfg(all(feature = "kiro_cli_subcommand", feature = "sanity"))]
29+
fn test_kiro_cli_subcommand() -> Result<(), Box<dyn std::error::Error>> {
30+
println!("\n🔍 Testing kiro-cli subcommand... | Description: Tests the <code> kiro-cli </code> subcommand that opens kiro-cli terminal for interactive AI conversations.");
31+
32+
println!("\n🔍 Executing 'kiro-cli' subcommand...");
33+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &[])?;
34+
35+
println!("📝 FULL OUTPUT:");
36+
println!("{}", response);
37+
println!("📝 END OUTPUT");
38+
39+
// Validate we got help output
40+
//check if mcp present
41+
if response.contains("mcp") {
42+
assert!(response.contains("loaded"), "Expected 'loaded' in reponse");
43+
assert!(response.contains("in"), "Expected 'in' in reponse");
44+
}
45+
assert!(response.contains("Did you know"), "Expected 'Did you know' in reponse.");
46+
assert!(response.contains("Model"), "Expected 'Model' in reponse.");
47+
assert!(response.contains("Auto"), "Expected 'Auto' in reponse.");
48+
49+
println!("✅ kiro-cli subcommand executed successfully!");
50+
2451
Ok(())
2552
}

e2etests/tests/model/test_model_dynamic_command.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,30 @@ fn test_model_h_command() -> Result<(), Box<dyn std::error::Error>> {
176176

177177
drop(chat);
178178

179+
Ok(())
180+
}
181+
182+
#[test]
183+
#[cfg(all(feature = "model", feature = "sanity"))]
184+
fn test_model_command() -> Result<(), Box<dyn std::error::Error>> {
185+
println!("\n🔍 Testing /model command... | Description: Tests the <code> /model </code> command to check it shows the auto model select");
186+
187+
let session = q_chat_helper::get_new_chat_session()?;
188+
let mut chat = session.lock().unwrap_or_else(|poisoned| poisoned.into_inner());
189+
190+
let response = chat.execute_command_with_timeout("/model",Some(500))?;
191+
192+
println!("📝 FULL OUTPUT:");
193+
println!("{}", response);
194+
println!("📝 END OUTPUT");
195+
196+
// Verify Usage section
197+
assert!(response.contains("Press"), "Expected 'Press' in response.");
198+
assert!(response.contains("Auto"), "Expected 'Auto' in response.");
199+
200+
println!("✅ Model content verified for Auto");
201+
202+
drop(chat);
203+
179204
Ok(())
180205
}

0 commit comments

Comments
 (0)