diff --git a/codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__standalone_windows_update_available_history_cell_snapshot.snap b/codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__standalone_windows_update_available_history_cell_snapshot.snap new file mode 100644 index 0000000000..adda66706e --- /dev/null +++ b/codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__standalone_windows_update_available_history_cell_snapshot.snap @@ -0,0 +1,11 @@ +--- +source: tui/src/history_cell/tests.rs +expression: rendered +--- +╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ ✨ Update available! 0.0.0 -> 9.9.9 │ +│ Run powershell -ExecutionPolicy Bypass -c '$env:CODEX_NON_INTERACTIVE=1; irm https://chatgpt.com/codex/install.ps1 | iex' to update. │ +│ │ +│ See full release notes: │ +│ https://github.com/openai/codex/releases/latest │ +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ diff --git a/codex-rs/tui/src/history_cell/tests.rs b/codex-rs/tui/src/history_cell/tests.rs index 7f846d39fb..beb04a66c7 100644 --- a/codex-rs/tui/src/history_cell/tests.rs +++ b/codex-rs/tui/src/history_cell/tests.rs @@ -1027,6 +1027,15 @@ fn web_search_history_cell_snapshot() { insta::assert_snapshot!(rendered); } +#[test] +fn standalone_windows_update_available_history_cell_snapshot() { + let cell = + UpdateAvailableHistoryCell::new("9.9.9".to_string(), Some(UpdateAction::StandaloneWindows)); + let rendered = render_lines(&cell.display_lines(/*width*/ 110)).join("\n"); + + insta::assert_snapshot!(rendered); +} + #[test] fn web_search_history_cell_wraps_with_indented_continuation() { let query = "example search query with several generic words to exercise wrapping".to_string(); diff --git a/codex-rs/tui/src/snapshots/codex_tui__update_prompt__tests__standalone_windows_update_prompt_modal.snap b/codex-rs/tui/src/snapshots/codex_tui__update_prompt__tests__standalone_windows_update_prompt_modal.snap deleted file mode 100644 index 41457446b1..0000000000 --- a/codex-rs/tui/src/snapshots/codex_tui__update_prompt__tests__standalone_windows_update_prompt_modal.snap +++ /dev/null @@ -1,15 +0,0 @@ ---- -source: tui/src/update_prompt.rs -expression: terminal.backend() ---- - - ✨ Update available! 0.0.0 -> 9.9.9 - - Release notes: https://github.com/openai/codex/releases/latest - -› 1. Update now (runs `powershell -ExecutionPolicy Bypass -c '$env:CODEX_NON_INTERACTIVE=1; irm - https://chatgpt.com/codex/install.ps1 | iex'`) - 2. Skip - 3. Skip until next version - - Press enter to continue diff --git a/codex-rs/tui/src/update_prompt.rs b/codex-rs/tui/src/update_prompt.rs index 5f7d2fc222..4d5a9e1287 100644 --- a/codex-rs/tui/src/update_prompt.rs +++ b/codex-rs/tui/src/update_prompt.rs @@ -250,11 +250,11 @@ mod tests { use ratatui::Terminal; fn new_prompt() -> UpdatePromptScreen { - prompt_for_action(UpdateAction::NpmGlobalLatest) - } - - fn prompt_for_action(update_action: UpdateAction) -> UpdatePromptScreen { - UpdatePromptScreen::new(FrameRequester::test_dummy(), "9.9.9".into(), update_action) + UpdatePromptScreen::new( + FrameRequester::test_dummy(), + "9.9.9".into(), + UpdateAction::NpmGlobalLatest, + ) } #[test] @@ -267,16 +267,6 @@ mod tests { insta::assert_snapshot!("update_prompt_modal", terminal.backend()); } - #[test] - fn standalone_windows_update_prompt_snapshot() { - let screen = prompt_for_action(UpdateAction::StandaloneWindows); - let mut terminal = Terminal::new(VT100Backend::new(110, 12)).expect("terminal"); - terminal - .draw(|frame| frame.render_widget_ref(&screen, frame.area())) - .expect("render update prompt"); - insta::assert_snapshot!("standalone_windows_update_prompt_modal", terminal.backend()); - } - #[test] fn update_prompt_confirm_selects_update() { let mut screen = new_prompt();