rho-coding-agent 3.10.0

A fast Rust agent harness with a small footprint and opinionated defaults
Documentation
use super::BrowserConfig;
use pretty_assertions::assert_eq;
use std::path::PathBuf;

// Covers: turning javascript_exec or an upload directory on or off leaves
// the browser the daemon runs as it is, since only which tools sessions
// get changes, while a key the browser starts with does change it.
// Otherwise enabling a tool closes the running browser and every
// session's tabs. Owner: browser config
#[test]
fn only_the_keys_a_browser_starts_with_change_the_browser() {
    let base = BrowserConfig::default();
    let cases = [
        (
            "javascript_exec",
            BrowserConfig {
                javascript_exec: true,
                ..BrowserConfig::default()
            },
            true,
        ),
        (
            "upload_dir",
            BrowserConfig {
                upload_dir: Some(PathBuf::from("/up")),
                ..BrowserConfig::default()
            },
            true,
        ),
        (
            "sandbox",
            BrowserConfig {
                sandbox: Some(false),
                ..BrowserConfig::default()
            },
            false,
        ),
    ];
    let same: Vec<_> = cases
        .iter()
        .map(|(case, config, _)| (*case, config.launch() == base.launch()))
        .collect();
    let expected: Vec<_> = cases.iter().map(|(case, _, same)| (*case, *same)).collect();
    assert_eq!(same, expected);
}