// Tests for mecha10_cli::handlers::init

use mecha10_cli::handlers::init::*;

use tempfile::TempDir;

#[test]
fn test_run_interactive_wizard_validation() {
    // Test is skipped because it requires user interaction
    // In a real test environment, you'd use a mock input provider
}

#[tokio::test]
async fn test_create_mecha10_json() -> Result<()> {
    let temp = TempDir::new()?;
    let path = temp.path().to_path_buf();

    create_mecha10_json(&path, "test-robot", &Some("rover".to_string())).await?;

    let config_path = path.join("mecha10.json");
    assert!(config_path.exists());

    let content = tokio::fs::read_to_string(config_path).await?;
    assert!(content.contains("\"name\": \"test-robot\""));
    assert!(content.contains("\"platform\": \"rover\""));

    Ok(())
}
