Lines
100 %
Functions
Branches
//! Each window records the cells it shows with its own id, resolved front to back.
use crate::app::tests::overlap::overlapped;
use crate::hits::Target;
use ratatui::layout::Position;
#[test]
fn the_front_window_owns_its_frame_over_the_body_of_the_window_behind() {
let (app, _, front) = overlapped();
let hit = app.hits.hit_at(Position::new(20, 8));
assert_eq!(
hit.map(|(_, target, id)| (target, id)),
Some((Target::Block, Some(front)))
);
}
fn a_window_shows_its_own_cells_where_nothing_covers_it() {
let (app, rear, _) = overlapped();
let hit = app.hits.hit_at(Position::new(5, 9));
assert_eq!(hit.map(|(_, _, id)| id), Some(Some(rear)));
fn the_desktop_between_windows_belongs_to_none() {
let (app, ..) = overlapped();
assert_eq!(app.hits.hit_at(Position::new(70, 20)), None);
fn the_rows_of_a_window_carry_its_id() {
let row = crate::test_support::area_of(&app, Target::Row(0));
let hit = app.hits.hit_at(Position::new(row.x, row.y));
Some((Target::Row(0), Some(front)))