//! Verifies the declared agent surface matches the domain subcommands.

use org_gdocs::TOOL_SPEC;
use tftio_cli_common::{AgentCapability, CommandSelector};

#[test]
fn tool_spec_declares_domain_agent_surface() {
    let surface = TOOL_SPEC
        .agent_surface()
        .expect("agent surface should be configured");

    let names: Vec<&str> = surface
        .capabilities()
        .iter()
        .map(AgentCapability::name)
        .collect();
    assert_eq!(
        names,
        [
            "push-projection",
            "pull-comments",
            "clean-comments",
            "open-doc"
        ]
    );

    let push = surface
        .capabilities()
        .first()
        .expect("push capability should exist");
    assert_eq!(push.commands(), &[CommandSelector::new(&["push"])]);
}
