core-agent-ide/codex-rs/tui
Ahmed Ibrahim 23a44ddbe8
Stabilize permissions popup selection tests (#14966)
## What is flaky
The permissions popup tests in the TUI are flaky, especially on Windows.
They assume the popup opens on a specific row and that a fixed number of
`Up` or `Down` keypresses will land on a specific preset. They also
match popup text too loosely, so a non-selected row can satisfy the
assertion.

## Why it was flaky
These tests were asserting incidental rendering details rather than the
actual selected permission preset. On Windows, the initial selection can
differ from non-Windows runs. Some tests also searched the entire popup
for text like `Guardian Approvals` or `(current)`, which can match a row
that is visible but not selected. Once the popup order or current preset
shifted slightly, a test could fail even though the UI behavior was
still correct.

## How this PR fixes it
This PR adds helpers that identify the selected popup row and selected
preset name directly. The tests now assert the current selection by
name, navigate to concrete target presets instead of assuming a fixed
number of keypresses, and explicitly set the reviewer state in the cases
that require `Guardian Approvals` to be current.

## Why this fix fixes the flakiness
The assertions now track semantic state, not fragile text placement.
Navigation is target-based instead of order-based, so
Windows/non-Windows row differences and harmless popup layout changes no
longer break the tests. That removes the scheduler- and
platform-sensitive assumptions that made the popup suite intermittent.

Co-authored-by: Ahmed Ibrahim <219906144+aibrahim-oai@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
2026-03-17 20:45:44 +00:00
..
frames Login flow polish (#3632) 2025-09-15 00:42:53 -07:00
src Stabilize permissions popup selection tests (#14966) 2026-03-17 20:45:44 +00:00
tests utils/pty: add streaming spawn and terminal sizing primitives (#13695) 2026-03-06 15:13:12 -08:00
BUILD.bazel fix: package models.json for Bazel tests (#13129) 2026-02-28 17:21:02 +01:00
Cargo.toml Revert tui code so it does not rely on in-process app server (#14899) 2026-03-17 00:56:32 -06:00
prompt_for_init_command.md chore: rename INIT.md to prompt_for_init_command.md and move closer to usage (#1886) 2025-08-06 11:58:57 -07:00
styles.md fix: stop using ANSI blue (#2421) 2025-08-18 16:02:25 +00:00
tooltips.txt Add /statusline tooltip entry (#12005) 2026-02-17 18:04:33 +00:00