Skip to content

test(input): drop unit tests that e2e tests now cover - #1528

Merged
Gaurav-Gosain merged 1 commit into
mainfrom
test/input-drop-covered-unit-tests
Nov 4, 2026
Merged

Gaurav-Gosain merged 1 commit into
mainfrom
test/input-drop-covered-unit-tests

Conversation

@Gaurav-Gosain

Copy link
Copy Markdown
Owner

Why

I audited the unit tests against the rule in AGENTS.md: a unit test stays only when it catches a bug the e2e suite misses. In internal/input, six tests repeat an assertion that an e2e test now makes on the real binary, and one only pins a default value.

Scope

Removed, each with the e2e test that holds the same behaviour:

Unit test Why it goes Covered by
TestCopyPipeAndCancelLeavesCopyMode The e2e test presses V k P, checks the piped output on the clipboard, and checks that copy mode ends. TestCopyPipeKeys (copy_pipe_test.go:207)
TestCloseSessionKeybindRaisesTheSameDialog The e2e test presses ctrl+b X, waits for the "Close session" dialog, cancels it, and checks the client is still up. TestSidebarCloseOffersWorktreeDelete (sidebar_close_worktree_test.go:74)
TestHintsCloseOnWheel The e2e test turns the wheel over open hints and waits for the labels to go. TestHintsDropAPasteAndCloseOnWheel (hints_test.go:609)
TestBaseLayoutKeyRunsPrefixBinding The e2e test sends the leader, then ш on the I key, and waits for the Inbox. TestBaseLayoutKeyOpensInbox (layout_keys_test.go:52)
TestRenameTakesASpace The e2e test types a two-word name and checks the committed name keeps its space. TestOptionBackspaceDeletesAWordInTheRenameEditor (word_delete_test.go:64)
TestHoverKeepsScratchShown With focus_follows_mouse on, the e2e test hovers outside the shown scratch box and checks the box stays and the keys still reach it. TestScratchStaysShownUnderHover (scratch_mouse_test.go:181)
TestCopyModeEntryConfig It only checked that the default copy_entry is cursor. none needed

The comment on TestRenameTakesNonASCII called the removed space test its other half. It now names the e2e test instead.

1358f7c restored TestCloseSessionKeybindRaisesTheSameDialog and TestRenameTakesASpace because no e2e test covered them then. The two covering e2e tests landed later, on 2026-10-21 and 2026-10-28.

I kept three tests that looked covered:

  • TestSwitcherEnterReachesThisMachineFromARemoteSession. The e2e test waits for "home" to be the current session. A switch sent to the far daemon by name could make a "home" session there and pass the same wait. That is the regression this unit test pins.
  • TestNvimNavigatorFocusRequestMustFollowForwardedKey. TestNvimNavigationOSCNeedsForwardedKey asserts both halves, but the rule stops a pane program from moving focus by itself. I read that as a trust boundary, which is a kept kind.
  • TestCtrlDragStillMoves. It matches TestCtrlDragArmsThenMoves today, but only this test turns alt_drag on.

Blast radius

Test files only. testselect reads each changed file as "a unit test file, not in the binary" and selects no e2e test. Each covering e2e test is in the test map, except TestOptionBackspaceDeletesAWordInTheRenameEditor, which is newer than the map, so testselect runs it on every change that reaches the binary. None of the removed tests is named in e2e/tui/NEGATIVE_CONTROLS.md.

Verification

  • go vet ./internal/input/ and go test -count=1 ./internal/input/ pass.
  • just check --changed passes: fmt, vet, lint, tuioslint, vuln, gopls, tidy, cross and deadcode. The fix report lists three findings in copymode_visual.go and handler.go, which this change does not touch.
  • testselect -base origin/main runs no tests of 1438 for this diff.

Six tests repeat an assertion an e2e test now makes on the real binary,
and TestCopyModeEntryConfig only pinned the default copy_entry value.
TestCloseSessionKeybindRaisesTheSameDialog and TestRenameTakesASpace
came back in 1358f7c because nothing under e2e/tui covered them then.
TestSidebarCloseOffersWorktreeDelete and
TestOptionBackspaceDeletesAWordInTheRenameEditor cover them now.
@Gaurav-Gosain
Gaurav-Gosain force-pushed the test/input-drop-covered-unit-tests branch from d4ce59a to 3559788 Compare November 4, 2026 10:35
@Gaurav-Gosain
Gaurav-Gosain merged commit 3559788 into main Nov 4, 2026
22 checks passed
@Gaurav-Gosain
Gaurav-Gosain deleted the test/input-drop-covered-unit-tests branch November 4, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant