mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-17 01:07:02 +02:00
test(workspace): move window to non existent container
Created a test for moving a window to a container that doesn't exist. The test ensures that we receive an error when moving a window to a container that doesn't exist.
This commit is contained in:
@@ -2291,6 +2291,25 @@ mod tests {
|
|||||||
assert_eq!(container.windows().len(), 1);
|
assert_eq!(container.windows().len(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_move_window_to_non_existent_container() {
|
||||||
|
let mut workspace = Workspace::default();
|
||||||
|
|
||||||
|
// Add a container with one window
|
||||||
|
let mut container = Container::default();
|
||||||
|
container.windows_mut().push_back(Window::from(1));
|
||||||
|
workspace.add_container_to_back(container);
|
||||||
|
|
||||||
|
// Try to move window to a non-existent container
|
||||||
|
let result = workspace.move_window_to_container(8);
|
||||||
|
|
||||||
|
// Should return an error
|
||||||
|
assert!(
|
||||||
|
result.is_err(),
|
||||||
|
"Expected an error when moving a window to a non-existent container"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_remove_window() {
|
fn test_remove_window() {
|
||||||
let mut workspace = Workspace::default();
|
let mut workspace = Workspace::default();
|
||||||
|
|||||||
Reference in New Issue
Block a user