From fc98d21ad8380fc4b52677f498908dc50f09d529 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim <219906144+aibrahim-oai@users.noreply.github.com> Date: Sat, 14 Mar 2026 03:55:32 +0000 Subject: [PATCH] Select Smart Approvals in session-configured popup tests Co-authored-by: Codex --- .codex/flaky-test-triage.md | 6 +++--- codex-rs/tui/src/chatwidget/tests.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.codex/flaky-test-triage.md b/.codex/flaky-test-triage.md index 692655afbe..ab8cd36347 100644 --- a/.codex/flaky-test-triage.md +++ b/.codex/flaky-test-triage.md @@ -46,9 +46,9 @@ Older failures also appeared on Linux, but the repeated cross-PR signal is stron ## Current Fix In Progress -- Harden the remaining permissions-history snapshot tests in `codex-rs/tui/src/chatwidget/tests.rs`. -- Assert that the popup starts on the current preset, then assert that navigation lands on the intended preset (`Full Access` or `Default`) before confirming. -- Rationale: these snapshot tests were still inferring cursor position from arrow-key count instead of proving which row was selected, which is the same brittle pattern already fixed in the neighboring Smart Approvals tests. +- Harden the `SessionConfigured` Smart Approvals popup tests in `codex-rs/tui/src/chatwidget/tests.rs`. +- Assert that `Smart Approvals (current)` is the selected row, not merely present somewhere in the popup body. +- Rationale: the same popup cluster was already showing selection-state brittleness on Windows CI. These two tests were still only checking rendered text and would miss a cursor-placement regression. ## Constraints diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index a1a798814d..8214f3cb14 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -8579,8 +8579,8 @@ async fn permissions_selection_marks_smart_approvals_current_after_session_confi let popup = render_bottom_popup(&chat, 120); assert!( - popup.contains("Smart Approvals (current)"), - "expected Smart Approvals to be current after SessionConfigured sync: {popup}" + selected_popup_line(&popup).contains("Smart Approvals (current)"), + "expected SessionConfigured sync to select Smart Approvals in the popup: {popup}" ); } @@ -8633,8 +8633,8 @@ async fn permissions_selection_marks_smart_approvals_current_with_custom_workspa let popup = render_bottom_popup(&chat, 120); assert!( - popup.contains("Smart Approvals (current)"), - "expected Smart Approvals to be current even with custom workspace-write details: {popup}" + selected_popup_line(&popup).contains("Smart Approvals (current)"), + "expected custom workspace-write details to keep Smart Approvals selected: {popup}" ); }