mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-18 23:44:00 +01:00
test(wm): toggle maximize a nonexistent window
The test ensures that we receive an error when attempting to toggle maximize a window that doesn't exist.
This commit is contained in:
@@ -5728,6 +5728,41 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_toggle_maximize_nonexistent_window() {
|
||||
let (mut wm, _context) = setup_window_manager();
|
||||
|
||||
{
|
||||
// Create a monitor
|
||||
let mut m = monitor::new(
|
||||
0,
|
||||
Rect::default(),
|
||||
Rect::default(),
|
||||
"TestMonitor".to_string(),
|
||||
"TestDevice".to_string(),
|
||||
"TestDeviceID".to_string(),
|
||||
Some("TestMonitorID".to_string()),
|
||||
);
|
||||
|
||||
// Create a container
|
||||
let container = Container::default();
|
||||
|
||||
// Add the container to the workspace
|
||||
let workspace = m.focused_workspace_mut().unwrap();
|
||||
workspace.add_container_to_back(container);
|
||||
|
||||
// Add monitor to the window manager
|
||||
wm.monitors_mut().push_back(m);
|
||||
}
|
||||
|
||||
// Should return an error when trying to toggle maximize on a non-existent window
|
||||
let result = wm.toggle_maximize();
|
||||
assert!(
|
||||
result.is_err(),
|
||||
"Expected an error when trying to toggle maximize on a non-existent window"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_monocle_on_and_monocle_off() {
|
||||
let (mut wm, _context) = setup_window_manager();
|
||||
|
||||
Reference in New Issue
Block a user