use crate::paint_probe::frame::Window;
use crate::test_support::window::{painted, queued, seated};
use crate::ui::theme;
const RULE: &str = "1 engine";
#[test]
fn the_window_is_the_transcript_the_rule_and_the_prompt() {
let mut model = seated();
let text = painted(&mut model);
for word in ["port it", RULE, theme::glyph::PROMPT] {
assert!(text.contains(word), "{word:?}:\n{text}");
}
assert!(
!text.lines().any(|line| line == crate::ui::roster::HEADING),
"no column is named:\n{text}"
);
}
#[test]
fn it_is_one_column_at_the_phone_s_width_too() {
let mut model = seated();
let text = Window::sized(400.0, 800.0).text(|ctx| crate::ui::render(ctx, &mut model));
for word in ["port it", theme::glyph::PROMPT] {
assert!(text.contains(word), "{word:?}:\n{text}");
}
}
#[test]
fn the_prompt_and_the_rule_stand_down_under_an_overlay() {
let mut model = queued();
let text = painted(&mut model);
assert!(!text.contains(crate::ui::composer::HINT), "{text}");
assert!(!text.contains(RULE), "{text}");
assert!(text.contains(crate::ui::queue::HEADING), "{text}");
}
#[test]
fn nothing_live_paints_under_the_enrollment() {
let mut model = seated();
model.begin_enrollment();
let text = painted(&mut model);
assert!(!text.contains(crate::ui::composer::HINT), "{text}");
assert!(!text.contains(RULE), "{text}");
}