use crate::test_support::window::{machines, seated};
use crate::ui::Model;
#[test]
fn the_pane_opens_only_where_the_window_is_aimed_at_a_wall() {
let mut nowhere = Model::default();
nowhere.begin_clients();
assert!(!nowhere.showing(crate::ui::Listing::Clients));
let mut model = seated();
model.begin_clients();
assert!(model.showing(crate::ui::Listing::Clients));
assert!(model.covered(), "it covers the conversation");
model.close_clients();
assert!(!model.showing(crate::ui::Listing::Clients));
}
#[test]
fn closing_the_pane_keeps_what_the_wall_answered() {
let mut model = machines();
model.close_clients();
assert!(!model.showing(crate::ui::Listing::Clients));
assert!(model.machines.is_some(), "the rows are the engine's");
}
#[test]
fn aiming_at_another_wall_retires_the_pane_and_its_rows() {
let mut model = machines();
model.aim_at("(this box's own engine)", "elsewhere");
assert!(!model.showing(crate::ui::Listing::Clients));
assert_eq!(model.machines, None);
}
#[test]
fn escape_puts_the_pane_down() {
let mut model = machines();
model.escape();
assert!(!model.showing(crate::ui::Listing::Clients));
assert!(model.machines.is_some(), "the rows are the engine's");
assert!(model.outbox.is_empty());
}