use super::{model, set_closed, world};
use crate::delete::{Step, plan};
#[test]
fn the_confirmation_names_the_bound_balls_and_the_plan_releases_them() {
let w = world();
set_closed(
&w,
r#"[{"id":"bl-done","title":"Done","claimant":"cobalt"}]"#,
);
let (_c, mut m) = model(&w);
m.after_bl_verb(&w.project);
let confirm = crate::boundary::answer::confirmation_of(&m.snap, &w.ws_cobalt).unwrap();
assert_eq!(confirm.ball_ids(), ["bl-work"], "live bound balls only");
assert!(
crate::boundary::answer::confirmation_of(&m.snap, &w.ws_spare)
.unwrap()
.ball_ids()
.is_empty(),
"a workspace no ball claims releases nothing"
);
assert_eq!(
plan(
&confirm,
std::path::Path::new("/w"),
std::path::Path::new("/world"),
&m.snap.projects,
)[0],
Step::Release {
project: w.project.clone(),
id: "bl-work".to_owned(),
name: "cobalt".to_owned(),
}
);
}