[Repo Assist] test: add coverage for handle_normal_mode key bindings#156
Draft
github-actions[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
28 new tests covering previously untested key paths in handle_normal_mode: - q / Esc → should_quit - ? → toggles show_help overlay - Tab / BackTab → focus zone toggle - S → cycles sort field (None → Name↑) - p (Search mode) → informational status - p (truncated ID) → status, no confirm - p (unpinned pkg) → Pin confirm dialog - p (pinned pkg) → Unpin confirm dialog - P (Search mode) → informational status - P (Installed mode) → cycles pin filter - i (truncated) → status, no confirm - i (valid) → Install confirm dialog - x (truncated) → status, no confirm - x (valid) → Uninstall confirm dialog - u (truncated) → status, no confirm - u (valid) → Upgrade confirm dialog - I (truncated) → status, stays in Normal mode - I (available_version present) → prefills VersionInput - I (no available_version) → falls back to current version - a → select all in Upgrades view - a (all selected) → deselect all - f → cycles source filter All → Winget - r → sets loading=true + "Refreshing..." status - Right → cycles view forward (Search → Installed) - Left → cycles view backward (Installed → Search) - Space → toggles package selection in Upgrades view Test count: 232 → 260 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
What
Adds 28 new tests to
src/handler.rscoveringhandle_normal_modekey bindings that had no test coverage.Why
handle_normal_modeis the central keyboard dispatcher — every normal-mode keystroke routes through it. Most of its branches (quit, help, focus, sort, install, uninstall, upgrade, pin, source filter, view switching, multi-select) were completely untested, meaning regressions could slip through silently.Covered key paths
q/Escshould_quitflag is set?show_helpoverlay on and offTab/BackTabSNonetoName ↑p(Search mode)p(truncated ID)p(unpinned pkg)Pinconfirm dialogp(pinned pkg)Unpinconfirm dialogP(Search mode)P(Installed mode)pin_filterAll → PinnedOnlyi(truncated)i(valid pkg)Installconfirm dialogx(truncated)x(valid pkg)Uninstallconfirm dialogu(truncated)u(valid pkg)Upgradeconfirm dialogI(truncated)I(available version)version_inputfromavailable_versionI(no available version)versionaa(all selected)fAll → Wingetrloading = true, status = "Refreshing..."RightLeftSpaceTest Status
No production code changed.