test(shared): add unit tests for 8 untested shared modules#208
Merged
Conversation
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>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-high→xhighnormalization, legacy ID migration)formatBytes.ts— human-readable byte formatting with binary unitspathUtils.ts— cross-platformgetBasenameandsplitPathpaneId.ts— draft pane ID creation/parsing withdraft:prefixsecretFormat.ts— encrypted secret prefix detection (lc-safe:v1:)gitUtils.ts— lock file detection across package managershomeScope.ts— home project identification helpersMotivation
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 typecheckpnpm run lintpnpm run test— all 120 new tests passScreenshots
N/A — no UI changes.
Linked issue
N/A
Link to Devin session: https://app.devin.ai/sessions/5193f3c5ea8347f7ae60b9df03f5dcd7
Requested by: @SDSLeon