mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-11 15:42:43 +02:00
test(wm): toggle monocle on nonexistent container
Created a test to test toggle monocle when a container doesn't exist in the monitor. The test ensures that we receive an error when attempting to call toggle monocle when a monitor doesn't contain a container.
This commit is contained in:
@@ -5905,6 +5905,34 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_toggle_monocle_nonexistent_container() {
|
||||||
|
let (mut wm, _context) = setup_window_manager();
|
||||||
|
|
||||||
|
{
|
||||||
|
// Create a monitor
|
||||||
|
let m = monitor::new(
|
||||||
|
0,
|
||||||
|
Rect::default(),
|
||||||
|
Rect::default(),
|
||||||
|
"TestMonitor".to_string(),
|
||||||
|
"TestDevice".to_string(),
|
||||||
|
"TestDeviceID".to_string(),
|
||||||
|
Some("TestMonitorID".to_string()),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add monitor to the window manager
|
||||||
|
wm.monitors_mut().push_back(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Should return an error when trying to toggle monocle on a non-existent container
|
||||||
|
let result = wm.toggle_monocle();
|
||||||
|
assert!(
|
||||||
|
result.is_err(),
|
||||||
|
"Expected an error when trying to toggle monocle on a non-existent container"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ensure_named_workspace_for_monitor() {
|
fn test_ensure_named_workspace_for_monitor() {
|
||||||
let (mut wm, _context) = setup_window_manager();
|
let (mut wm, _context) = setup_window_manager();
|
||||||
|
|||||||
Reference in New Issue
Block a user