diff --git a/codex-rs/tui/src/onboarding/trust_directory.rs b/codex-rs/tui/src/onboarding/trust_directory.rs index fd24b8e88..cf5d6e9a1 100644 --- a/codex-rs/tui/src/onboarding/trust_directory.rs +++ b/codex-rs/tui/src/onboarding/trust_directory.rs @@ -189,13 +189,14 @@ mod tests { use crossterm::event::KeyModifiers; use pretty_assertions::assert_eq; use ratatui::Terminal; - use std::path::PathBuf; + use tempfile::TempDir; #[test] fn release_event_does_not_change_selection() { + let codex_home = TempDir::new().expect("temp home"); let mut widget = TrustDirectoryWidget { - codex_home: PathBuf::from("."), + codex_home: codex_home.path().to_path_buf(), cwd: PathBuf::from("."), is_git_repo: false, selection: None, @@ -217,8 +218,9 @@ mod tests { #[test] fn renders_snapshot_for_git_repo() { + let codex_home = TempDir::new().expect("temp home"); let widget = TrustDirectoryWidget { - codex_home: PathBuf::from("."), + codex_home: codex_home.path().to_path_buf(), cwd: PathBuf::from("/workspace/project"), is_git_repo: true, selection: None,