Skip to content

test(shared): add unit tests for 8 untested shared modules#208

Merged
SDSLeon merged 2 commits into
masterfrom
devin/1781907396-add-unit-tests-coverage
Jun 21, 2026
Merged

test(shared): add unit tests for 8 untested shared modules#208
SDSLeon merged 2 commits into
masterfrom
devin/1781907396-add-unit-tests-coverage

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Added 120 unit tests across 9 new test files for shared modules that previously had zero test coverage. These modules contain ~494 lines of core logic used throughout the app.

Modules now covered:

  • paneLayout.ts — tree-based pane layout manipulation (build from legacy, collect IDs, replace, swap, split, remove, insert, alignment, path finding)
  • rowLayout.ts — row/column grid utilities (effective layout, index-to-row/col, add/remove/insert rows)
  • cursorModelId.ts — Cursor model ID parsing (effort tiers, fast/thinking flags, extra-highxhigh normalization, legacy ID migration)
  • formatBytes.ts — human-readable byte formatting with binary units
  • pathUtils.ts — cross-platform getBasename and splitPath
  • paneId.ts — draft pane ID creation/parsing with draft: prefix
  • secretFormat.ts — encrypted secret prefix detection (lc-safe:v1:)
  • gitUtils.ts — lock file detection across package managers
  • homeScope.ts — home project identification helpers

Motivation

These shared utility modules are foundational to the app (pane layout, path handling, secret format detection, etc.) but had no automated test coverage. Adding tests catches regressions early and documents expected behavior.

Testing

  • pnpm run typecheck
  • pnpm run lint
  • pnpm run test — all 120 new tests pass

Screenshots

N/A — no UI changes.

Linked issue

N/A

Link to Devin session: https://app.devin.ai/sessions/5193f3c5ea8347f7ae60b9df03f5dcd7
Requested by: @SDSLeon

Add comprehensive unit tests for 8 shared modules that previously had
zero test coverage:

- paneLayout.ts (291 lines): layout tree manipulation (build, collect,
  replace, swap, split, remove, insert, align, path finding)
- rowLayout.ts (75 lines): row/column grid utilities
- cursorModelId.ts (39 lines): Cursor model ID parsing with effort/fast/thinking
- formatBytes.ts (9 lines): byte formatting with binary units
- pathUtils.ts (10 lines): cross-platform path basename and splitting
- paneId.ts (21 lines): draft pane ID creation and parsing
- secretFormat.ts (14 lines): encrypted secret prefix detection
- gitUtils.ts (23 lines): lock file detection
- homeScope.ts (12 lines): home project identification

Total: 120 new test cases covering ~494 lines of previously untested code.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot requested a review from SDSLeon as a code owner June 19, 2026 22:19
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lightcode-landing Ready Ready Preview, Comment Jun 21, 2026 5:47am

@SDSLeon SDSLeon merged commit 406f920 into master Jun 21, 2026
6 checks passed
@SDSLeon SDSLeon deleted the devin/1781907396-add-unit-tests-coverage branch June 21, 2026 05:52
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