Skip to content

test(pty): split live UI suite by scope#357

Merged
benvinegar merged 1 commit into
mainfrom
test/split-pty-suite
May 23, 2026
Merged

test(pty): split live UI suite by scope#357
benvinegar merged 1 commit into
mainfrom
test/split-pty-suite

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Summary

  • split the monolithic PTY UI test suite into scoped files: notes, nav, layout, pager, chrome, and scroll
  • move shared mouse/row helpers into the PTY harness
  • remove the old ui-integration.test.ts wrapper file

Tests

  • bun test test/pty
  • bun run typecheck
  • bun run lint

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 23, 2026

Greptile Summary

This PR breaks apart the 2028-line ui-integration.test.ts into six focused test files (chrome, layout, nav, notes, pager, scroll) and moves the shared mouse/row helpers into the PTY harness as exported functions. No test logic is changed — it is a pure structural refactoring.

  • test/pty/harness.ts: Promotes sleep, moveMouse, dragMouse, rightmostColumnOf, lineIndexOf, revealAddNoteAffordance, revealAddNoteNear, and revealAddNoteOnRow to named exports. The Session type was already imported at the top of the file, so no new import is needed.
  • New test files (chrome, layout, nav, notes, pager, scroll): Each creates its own createPtyHarness() instance, registers afterEach cleanup, and calls setDefaultTimeout(20_000); no shared state exists between files.
  • ui-integration.test.ts: Deleted; all 2028 lines are fully accounted for across the new files plus the helper migration.

Confidence Score: 5/5

Pure test reorganization with no changes to production code or test logic; safe to merge.

Every test from the deleted monolithic file is faithfully reproduced in the new scoped files. Shared helpers are exported from a module that already imported the required types. Each test file manages its own harness instance, so there is no cross-file state to leak. Nothing in the application under test is touched.

No files require special attention.

Important Files Changed

Filename Overview
test/pty/harness.ts Adds exported helper functions (moveMouse, dragMouse, revealAddNoteAffordance, revealAddNoteNear, revealAddNoteOnRow, rightmostColumnOf, lineIndexOf, sleep) that were previously local to ui-integration.test.ts; Session type was already imported so no new import is needed.
test/pty/chrome.test.ts New scoped test file covering top-menu mouse navigation, filter/slash focus, keyboard help, and layout switching; faithfully migrated from the monolithic suite.
test/pty/layout.test.ts New scoped test file covering wide-character separator alignment, wrap toggle, context expand/collapse, live resize, sidebar drag, hotkey layout switching, and horizontal scroll.
test/pty/nav.test.ts New scoped test file covering comment navigation, forward/backward hunk navigation, cross-file navigation, sidebar file selection, and pinned-header clicks.
test/pty/notes.test.ts New scoped test file covering agent note reveal/hide, user note drafting/saving, add-note affordance visibility, draft cancel/save shortcuts, stack/deletion/context-row drafts, and focus blocking.
test/pty/pager.test.ts New scoped test file covering pager mode space/half-page/page-up navigation, piped-stdin startup, mouse wheel scrolling in stdin and TTY modes, sidebar display, and auto-theme pager.
test/pty/scroll.test.ts New scoped test file covering bottom-edge upward scroll, scrollbar click/drag, mouse wheel scrolling with pinned headers, and collapsed-gap scroll edge cases.
test/pty/ui-integration.test.ts Deleted 2028-line monolithic test file; all tests redistributed into the six new scoped files, and all local helpers migrated to harness.ts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    H[test/pty/harness.ts]
    H --> C[chrome.test.ts]
    H --> L[layout.test.ts]
    H --> N[nav.test.ts]
    H --> NO[notes.test.ts]
    H --> P[pager.test.ts]
    H --> S[scroll.test.ts]
Loading

Reviews (1): Last reviewed commit: "test(pty): split live UI suite by scope" | Re-trigger Greptile

@benvinegar benvinegar merged commit d8d0bbd into main May 23, 2026
6 checks passed
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