Add comprehensive test coverage - achieve 85.86% overall coverage#8
Merged
Add comprehensive test coverage - achieve 85.86% overall coverage#8
Conversation
β¦erage This commit adds 43 new test cases for popup.js, bringing overall project coverage from 55.16% to 85.86%, exceeding the 80% target. New test file: - popup.test.js: 43 tests covering all UI event handlers, status display, bookmark operations, and error scenarios Coverage improvements: - Overall: 55.16% β 85.86% (+30.7pp) β EXCEEDS 80% TARGET - popup.js: 0% β 92.62% (+92.62pp) - Statements: 55.16% β 85.86% (+30.7pp) - Branches: 76.67% β 85.37% (+8.7pp) - Lines: 55.15% β 85.79% (+30.64pp) Test coverage includes: - All 6 button event handlers (organize, dedupe, save, restore, remove) - Status message display and timeouts - Bookmark folder selection UI - Error handling and edge cases - DOM manipulation and async operations Implementation notes: - Custom DOM mocking to avoid JSDOM dependency - Mock Chrome runtime.sendMessage API - Comprehensive async operation testing - All 229 tests passing π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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
This PR adds comprehensive test coverage for the Chrome Tab Manager extension, bringing overall coverage from 50.54% to 85.86%, exceeding the 80% target.
Coverage Improvements
Per-File Coverage
background.js
popup.js
Changes
New Test Files
removeAllGroups.test.js(21 tests)getTabOrganizerBookmarkFolders.test.js(32 tests)popup.test.js(43 tests)Code Changes
background.js: AddedremoveAllGroupsto module exports for testingTest Results
Implementation Notes
Test Coverage Details
removeAllGroups.test.js
getTabOrganizerBookmarkFolders.test.js
popup.test.js
Remaining Coverage Gaps
The uncovered code consists primarily of:
background.js(lines 542-581)These are mostly integration points and edge branches that would require additional mocking complexity.
π€ Generated with Claude Code