LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Batch fix: the CLI snapshot test settles before its screenshots
Claude41e67e1edd77
diff --git a/apps/lightcraft-cli/tests/cli.rs b/apps/lightcraft-cli/tests/cli.rsindex 21fa6310d..d1b178e49 100644--- a/apps/lightcraft-cli/tests/cli.rs+++ b/apps/lightcraft-cli/tests/cli.rs@@ -167,10 +167,14 @@ fn snapshot_subcommand_renders_the_ui_headlessly() {std::fs::write(&script,format!(- "# comment\n{}\n{}\n{}\n{}\n",+ "# comment\n{}\n{}\n{}\n{}\n{}\n{}\n",json!({"method": "ui.set", "params": {"view": "photoGrid"}}),+ // (settled: under load a grid shot taken before its thumbnails is darker than the+ // dimmed export dialog over them, and the comparison below fails)+ json!({"method": "ui.settle", "params": {"timeoutMs": 20000}}),json!({"method": "ui.screenshot"}),json!({"method": "engine.execute", "params": {"command": "dialog.export"}}),+ json!({"method": "ui.settle", "params": {"timeoutMs": 20000}}),json!({"method": "ui.screenshot", "params": {"path": b.to_str().unwrap()}}),),)@@ -181,7 +185,7 @@ fn snapshot_subcommand_renders_the_ui_headlessly() {.unwrap();assert!(o.status.success(), "{}", String::from_utf8_lossy(&o.stderr));let replies: Vec<Value> = String::from_utf8_lossy(&o.stdout).lines().map(|l| serde_json::from_str(l).unwrap()).collect();- assert_eq!(replies.len(), 4);+ assert_eq!(replies.len(), 6);assert!(replies.iter().all(|r| r["ok"] == true), "{replies:?}");for (p, dimmed) in [(&a, false), (&b, true)] {let d = lightcraft_codecs::decode(&std::fs::read(p).unwrap(), Default::default()).unwrap();