diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 30d327c6f..161a056b6 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -830,15 +830,18 @@ fn missing_recent_is_marked_and_its_error_shows() { /// The existence probe tells present files from missing ones and never touches remote paths. #[test] fn recent_exists_tells_missing_from_present() { - let mut harness = crate::test_harness::harness(Session::new(), Services::default()); + let path = std::path::PathBuf::from("/deckcraft-tests/172/present.deckcraft"); + let files = std::sync::Arc::new(craft::host::ScriptedFiles::new().with_file(&path, Vec::new())); + let mut harness = crate::test_harness::harness_with( + Session::new(), + Services::default(), + egui_kittest::Harness::builder().with_size(egui::vec2(1440.0, 900.0)), + |platform| platform.host = platform.host.with_files(files), + ); let app = harness.state_mut(); - let mut path = std::env::temp_dir(); - path.push(format!("deckcraft-test-172-{}.deckcraft", std::process::id())); - std::fs::write(&path, b"").unwrap(); assert!(app.recent_exists(&path.to_string_lossy()), "the file exists"); assert!(!app.recent_exists("/deckcraft-tests/172/missing.deckcraft")); assert!(app.recent_exists("\\\\server/share/deck.deckcraft"), "UNC paths are never probed"); - std::fs::remove_file(&path).ok(); } /// #339: clicking a language in Review > Language did nothing, and OK didn't mark the text.