test(windows): pin the JSON of Container

Before the container moves into a shared crate: a test that fixes the
serialised form of the Windows Container (id, locked, windows with
elements and focused) for an empty container, next to the existing
deserialize test, so the move cannot change what `komorebic state`
prints.

Verified: not run (Windows tests do not run on Linux); type-checked by
the Windows clippy gate at the end of this stack.
This commit is contained in:
LGUG2Z committed 2026-10-31 11:36:54 -07:00
1 parent 2d2dff101c
commit 27b84796e5
1 file changed
+14
+14
View File
@@ -299,6 +299,20 @@ mod tests {
assert_eq!(container.focused_window_idx(), 1);
}
#[test]
fn the_json_of_a_container_is_its_id_whether_it_is_locked_and_the_ring_of_windows() {
let container = Container {
id: "c1".to_string(),
locked: true,
windows: Default::default(),
};
assert_eq!(
serde_json::to_string(&container).unwrap(),
r#"{"id":"c1","locked":true,"windows":{"elements":[],"focused":0}}"#
);
}
#[test]
fn serializes_and_deserializes() {
let mut container = Container::default();