Skip to content

test: cover tree selector, Python/Ruby/Global integration, and DirSize - #11

Merged
ohing504 merged 2 commits into
mainfrom
test-coverage-ui-integration
Jul 17, 2026
Merged

test: cover tree selector, Python/Ruby/Global integration, and DirSize#11
ohing504 merged 2 commits into
mainfrom
test-coverage-ui-integration

Conversation

@ohing504

Copy link
Copy Markdown
Owner

What

P2-7 test coverage. Closes the untested areas from code-health finding #12 and the coverage survey.

Changes

  • internal/ui — the interactive tree selector's toggle (toggleCurrent), parent/child selection propagation (updateProjectState/isPartiallySelected), cursor movement (moveCursor/jumpProject), remaining quick-select keys (selectNone/selectByActivity), and Update key routing (via injected tea.KeyMsg) are now tested. Coverage 35% → 57%.
  • internal/integration_test.go — the scan workspace gained Python (__pycache__, .pytest_cache) and Ruby (vendor/bundle, .bundle) project fixtures flowing through the real registry pipeline; a new test drives the Global (fixed-home) scanner through the registry with an injected HOME. Golden output regenerated for the new fixtures.
  • internal/scanner/sizing_test.goDirSize now has a test pinning the sizing arithmetic (reported size covers the logical content as a lower bound and grows with more data), the one thing the golden test can't check since it zeroes Size out for portability.

Verification

  • go test ./... — all pass; go test -race ./internal/ui/ clean.
  • golangci-lint run ./... — 0 issues.
  • internal/ui 35.3% → 56.5%.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc

ohing504 and others added 2 commits July 17, 2026 15:56
- ui: exercise the tree selector's toggle, parent/child selection
  propagation, cursor movement, quick-select keys, and Update key
  routing via injected KeyMsgs (internal/ui 35% -> 57%).
- integration: add Python and Ruby project fixtures to the scan
  workspace and a Global-scanner pipeline test that injects HOME;
  regenerate the golden output for the new fixtures.
- scanner: pin DirSize's sizing arithmetic (lower bound + growth),
  which the golden test can't verify since it zeroes Size out for
  portability.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc
Review follow-ups on the P2-7 test additions:

- Zero ProjectRoot alongside the other volatile fields before writing
  the golden file — it held the committer's absolute temp path, leaking
  machine-specific data into version control.
- Build the Global scanner directly with an isolated TmpRoot and a
  stubbed process check instead of going through the registry, so the
  HOME-injected test no longer scans real machine temp state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YSTf3ozF4SnboZHyEi7Ycc
@ohing504
ohing504 merged commit 11ab2b7 into main Jul 17, 2026
3 checks passed
@ohing504
ohing504 deleted the test-coverage-ui-integration branch July 17, 2026 07:20
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