facett-cicd/tests/robot.rs
//! **Robot JSON-drive scenario for the CI/CD forge panel**, driven through the
//! SHARED generic-Facet probe in `facett_core::harness`. The pane's `update_json`
//! robot seam was a **dead no-op** (the `impl_facet_via_elm!` bridge generates
//! none); this makes it LIVE and proves it end-to-end, and adds the shared probe's
//! `headless_render` + `responds_to_input` functional cells via
//! `facett_core::testmatrix::probe_and_emit` (no-op unless built with
//! `--features testmatrix`). `responds_to_input` is NEW coverage that goes RED if
//! the drive seam regresses. See `.nornir/facett-platform-gaps.md`.
use facett_cicd::CicdPanel;
#[test]
fn robot_json_drive_scenario() {
let mut view = CicdPanel::demo();
let script = [
r#"{"select_pipeline":"nornir-ci"}"#, // focus a pipeline
r#""clear_selection""#, // clear it again
];
let probe = facett_core::testmatrix::probe_and_emit("facett-cicd", &mut view, &script);
assert!(probe.drew(), "the forge panel must tessellate to vertices");
assert!(probe.cardinality() > 0, "state_json reports the pipeline roster");
assert!(probe.responded(), "update_json must drive state — a dead seam is a regression");
assert_eq!(
probe.steps[0].state["selected_pipeline"], "nornir-ci",
"select_pipeline pins the pipeline id"
);
assert!(probe.steps[0].changed, "select_pipeline moved state");
assert_eq!(
probe.final_state["selected_pipeline"],
serde_json::Value::Null,
"clear_selection cleared it"
);
}