test: optimize UI tests by removing trivial and mock-focused tests - #34
Closed
GoBeromsu wants to merge 2 commits into
Closed
test: optimize UI tests by removing trivial and mock-focused tests#34GoBeromsu wants to merge 2 commits into
GoBeromsu wants to merge 2 commits into
Conversation
## Test Structure Changes - api/providers/unified.test.ts → api/UnifiedProvider.test.ts - ui/components/commonButton.test.ts → ui/components/common/CommonButton.test.ts - ui/components/commonNotice.test.ts → ui/components/common/CommonNotice.test.ts - ui/containers/apiContainer.test.ts → ui/containers/Api.test.ts - ui/containers/frontmatterContainer.test.ts → ui/containers/Frontmatter.test.ts - ui/containers/tagContainer.test.ts → ui/containers/Tag.test.ts ## New Tests Added - __tests__/api/prompt.test.ts (19 tests) - __tests__/frontmatter/index.test.ts expanded (32 tests) - __tests__/utils/index.test.ts (38 tests) ## Mock Improvements - Added Obsidian API mocks: getFrontMatterInfo, parseFrontMatterStringArray, getAllTags - Added MetadataCache and TFile classes for testing Total: 134 tests across 10 test suites 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove tests that only verify: - Mock method calls without actual logic validation - Trivial data structure existence checks - Simple rendering side effects (e.g., container.empty called) Deleted files: - CommonButton.test.ts: Only tested mock method calls, no actual UI logic - Api.test.ts: Tested trivial data assignments and mock behavior Modified files: - Frontmatter.test.ts: Removed trivial "Basic Rendering" tests, kept critical regression tests for filtering and template management logic - Tag.test.ts: Removed trivial "Basic Rendering" test, kept critical regression tests for tag setting management Kept tests verify actual behavior: - CommonNotice.test.ts: Tests actual error handling, progress management, and async wrappers - Frontmatter template filtering (id=0), delete, and edit logic - Tag setting update and error handling edge cases Test results: 7/8 suites pass (1 unrelated failure in api/prompt.test.ts) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <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
Changes
Deleted Files
__tests__/ui/components/common/CommonButton.test.ts(54 lines)__tests__/ui/containers/Api.test.ts(165 lines)Modified Files
__tests__/ui/containers/Frontmatter.test.ts__tests__/ui/containers/Tag.test.tsKept Tests
All remaining tests verify actual behavior:
CommonNotice.test.ts: Error handling, progress management, async wrappersTest Results
Impact
🤖 Generated with Claude Code