Skip to content

Commit fceacb9

Browse files
author
Nitish [C] Dhok
committed
kiro-cli e2e tests: added tests case automation for kiro-cli init --verbose fish post and kiro-cli init --verbose fish pre subcommands
1 parent 8918236 commit fceacb9

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

e2etests/tests/init/test_kiro_cli_init_subcommand.rs

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,5 +387,63 @@ fn test_kiro_cli_init_verbose_zsh_post_subommand() -> Result<(), Box<dyn std::er
387387

388388
println!("✅ Kiro Cli init --verbose zsh post subcommand executed successfully!");
389389

390+
Ok(())
391+
}
392+
393+
#[test]
394+
#[cfg(all(feature = "init", feature = "sanity"))]
395+
fn test_kiro_cli_init_verbose_fish_pre_subommand() -> Result<(), Box<dyn std::error::Error>> {
396+
println!("\n🔍 Testing kiro-cli init --verbose fish pre ... | Description: Tests the <code> kiro-cli init --verbose fish pre </code> subcommand to verify verbose fish pre response.");
397+
398+
println!("\n🔍 Executing 'kiro-cli init --verbose fish pre' subcommand...");
399+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["init","--verbose","fish","pre"])?;
400+
401+
println!("📝 FULL OUTPUT:");
402+
println!("{}", response);
403+
println!("📝 END OUTPUT");
404+
405+
assert!(response.contains("SHOULD_QTERM_LAUNCH"), "Expected 'SHOULD_QTERM_LAUNCH' in the output");
406+
assert!(response.contains("command mkdir -p"), "Expected 'command mkdir -p' in the output");
407+
assert!(response.contains("Q_NEW_SESSION"), "Expected 'Q_NEW_SESSION' in the output");
408+
409+
assert!(response.contains("Q_PARENT"), "Expected 'Q_PARENT' in the output");
410+
assert!(response.contains("kiro-cli-term"), "Expected 'kiro-cli-term' in the output");
411+
assert!(response.contains("Q_SHELL"), "Expected 'Q_SHELL' in the output");
412+
413+
assert!(response.contains("exec bash -c"), "Expected 'exec bash -c' in the output");
414+
assert!(response.contains("Q_IS_LOGIN_SHELL"), "Expected 'Q_IS_LOGIN_SHELL' in the output");
415+
assert!(!response.contains("fig_preexec"), "fish pre should not contain fig_preexec hooks");
416+
417+
println!("✅ Kiro Cli init --verbose fish pre subcommand executed successfully!");
418+
419+
Ok(())
420+
}
421+
422+
#[test]
423+
#[cfg(all(feature = "init", feature = "sanity"))]
424+
fn test_kiro_cli_init_verbose_fish_post_subommand() -> Result<(), Box<dyn std::error::Error>> {
425+
println!("\n🔍 Testing kiro-cli init --verbose fish post ... | Description: Tests the <code> kiro-cli init --verbose fish post </code> subcommand to verify verbose fish post response.");
426+
427+
println!("\n🔍 Executing 'kiro-cli init --verbose fish post' subcommand...");
428+
let response = q_chat_helper::execute_q_subcommand("kiro-cli", &["init","--verbose","fish","post"])?;
429+
430+
println!("📝 FULL OUTPUT:");
431+
println!("{}", response);
432+
println!("📝 END OUTPUT");
433+
434+
assert!(response.contains("fig_preexec"), "Expected 'fig_preexec' in the output");
435+
assert!(response.contains("fig_precmd"), "Expected 'fig_precmd' in the output");
436+
assert!(response.contains("fig_wrap_prompt"), "Expected 'fig_wrap_prompt' in the output");
437+
438+
assert!(response.contains("fig_copy_fn"), "Expected 'fig_copy_fn' in the output");
439+
assert!(response.contains("StartPrompt"), "Expected 'StartPrompt' in the output");
440+
assert!(response.contains("EndPrompt"), "Expected 'EndPrompt' in the output");
441+
442+
assert!(response.contains("fish_prompt"), "Expected 'fish_prompt' in the output");
443+
assert!(response.contains("QTERM_SESSION_ID"), "Expected 'QTERM_SESSION_ID' in the output");
444+
assert!(!response.contains("SHOULD_QTERM_LAUNCH"), "fish post should not contain terminal launch logic");
445+
446+
println!("✅ Kiro Cli init --verbose fish post subcommand executed successfully!");
447+
390448
Ok(())
391449
}

0 commit comments

Comments
 (0)