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_on_a_row_brazen_lacks_wears_its_fault_in_the_pane() {
let mut world = world();
world.fx.commit_other(
crate::model_pick::PROVIDERS,
"roles:\n worker:\n provider: codex\n model: gpt-5.4\n",
);
let out = open_pane(&mut world);
assert!(
out.contains("worker · gpt-5.4 ⚠"),
"the dead assignment is marked in the strip:\n{out}"
);
let said = crate::model_pick::PickError::UnknownProvider {
provider: "codex".to_string(),
}
.to_string();
assert!(
out.contains(&format!("⚠ {said}")),
"and the selected role's reason is painted in full under it:\n{out}"
);
}