use crate::test_support::window::seated;
use crate::ui::{Aim, Model};
#[test]
fn the_aim_is_a_channel_and_an_address_together() {
let aim = Aim {
channel: "one".to_owned(),
address: "home".to_owned(),
};
let model = Model {
aim: Some(aim.clone()),
..seated()
};
assert_eq!(model.aim.as_ref(), Some(&aim));
assert_ne!(
model.aim.as_ref(),
Some(&Aim {
channel: "one".to_owned(),
address: "other".to_owned(),
})
);
assert_eq!(Model::default().aim, None);
}
#[test]
fn a_channel_is_held_only_while_the_roster_carries_it() {
let model = seated();
let held = model.roster[0].channel.name.clone();
assert!(model.holds(&held));
assert!(!model.holds("a channel this box never had"));
}