Skip to content

test: add regression tests for 12 merged PRs#82

Closed
yoziv wants to merge 1 commit into
InbarR:mainfrom
yoziv:test/yoziv/regression-tests-merged-prs
Closed

test: add regression tests for 12 merged PRs#82
yoziv wants to merge 1 commit into
InbarR:mainfrom
yoziv:test/yoziv/regression-tests-merged-prs

Conversation

@yoziv
Copy link
Copy Markdown
Contributor

@yoziv yoziv commented Apr 29, 2026

Adds regression tests covering 12 merged PRs that had no test coverage.

Pure-function tests (76 assertions, run in ~1s without packaging)

Spec file PRs covered Tests What it guards
pr53-56-clipboard-link-extract #53, #56 16 HTML link extraction, protocol validation, safelink unwrap
pr57-path-traversal-guard #57 10 ../ escape, sibling-prefix attack, root boundaries
pr58-open-path-guard #58 28 All 25 dangerous extensions blocked, safe ones allowed
pr60-wsl-distro-validation #60 9 Path injection, command injection, special chars

E2E tests (require npm run package)

Spec file PR What it guards
pr75-session-rename-title #75 Rename propagates to linked pane, flags set correctly
pr13-minimum-pane-size #13 Split ratio clamped, double-click resets to 50/50
pr14-dec-focus-sequences #14 Focus switch triggers DEC sequences
pr9-shortcuts-escape-capture #9 Escape closes dialog in capture phase
pr10-pane-title-overlap #10 Title doesn't overlap terminal viewport
pr8-shifted-key-binding #8 Ctrl+Shift+/ uses shifted char

Refactoring

  • Extracted duplicated extractLinkFromHtml/unwrapSafelinks from TerminalPanel.tsx and DetachedApp.tsx into shared src/renderer/utils/link-extract.ts
  • Extracted security validation helpers into src/main/utils/security-guards.ts

Pure-function tests (run without Electron packaging):
- PR InbarR#53/InbarR#56: extractLinkFromHtml + unwrapSafelinks (16 tests)
  Extracted to src/renderer/utils/link-extract.ts, shared by
  TerminalPanel.tsx and DetachedApp.tsx (deduplication)
- PR InbarR#57: path traversal guard (10 tests)
  Extracted to src/main/utils/security-guards.ts
- PR InbarR#58: OPEN_PATH extension blocklist (28 tests)
- PR InbarR#60: WSL distro name validation (9 tests)

E2E tests (require npm run package):
- PR InbarR#75: session rename propagates to pane title
- PR InbarR#13: minimum pane size enforcement
- PR InbarR#14: DEC focus sequence injection on pane switch
- PR InbarR#9: ShortcutsHelp escape in capture phase
- PR InbarR#10: pane title doesn't overlap terminal content
- PR InbarR#8: shifted key character in Ctrl+Shift+/ binding

Also extracts duplicated link-extract functions from
TerminalPanel.tsx and DetachedApp.tsx into a shared utility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@InbarR
Copy link
Copy Markdown
Owner

InbarR commented May 2, 2026

Landed directly on main (commit 7ade193 from this PR + a follow-up fix df56801 correcting a typo in the pr9 spec - showShortcutsHelp -> showShortcuts to match the actual store field). Thanks for the regression coverage!

@InbarR InbarR closed this May 2, 2026
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.

2 participants