use super::fixture::world;
use super::painted;
use crate::cli_outbound::Cli;
fn open_pane(world: &mut super::fixture::World) -> String {
let (lernie, bl) = (Cli::new("yog-absent-lernie"), Cli::new("yog-absent-bl"));
let ws = world.ws.clone();
world.model.focus_agent(&ws, "c-1");
let _ = painted(world, &lernie, &bl);
world.state.wall.picker.open = true;
painted(world, &lernie, &bl)
}
#[test]
fn the_open_pane_paints_the_role_strip_the_config_declares() {
let mut world = world();
let out = open_pane(&mut world);
assert!(
!out.contains("cannot read `roles:`"),
"the fixture's workspace carries a config lineage now:\n{out}"
);
assert!(out.contains("role"), "the strip's own label:\n{out}");
for role in ["worker · claude-sonnet-5", "compactor · claude-haiku-4-5"] {
assert!(
out.contains(role),
"the strip names {role:?} — the assignment read off the branch, \
beside the role it is scoped to:\n{out}"
);
}
}
#[test]
fn the_open_pane_states_the_blast_radius_of_a_pick() {
let mut world = world();
let out = open_pane(&mut world);
assert!(
out.contains("changes config/default for the whole ws workspace"),
"the branch and the workspace a pick moves:\n{out}"
);
assert!(
out.contains("this one stays frozen at"),
"and the conversation it exempts, named by its governing commit:\n{out}"
);
}
#[test]
fn a_role_whose_model_is_undeclared_wears_its_fault_in_the_pane() {
let mut world = world();
let out = open_pane(&mut world);
assert!(
out.contains("worker · claude-sonnet-5 ⚠"),
"the dead assignment is marked in the strip:\n{out}"
);
assert!(
out.contains(
"⚠ claude-sonnet-5 is not declared in models.yaml — lernie refuses to load a \
config whose role names an undeclared model"
),
"and the selected role's reason is painted in full under it:\n{out}"
);
}