Repository navigation
Fix UI & Service Integration Issues (ALL 14 test failures fixed - 100% complete) - #257
Merged
Merged
Conversation
- Added sharedNodeStore.__resetForTesting() to global beforeEach in setup.ts - Prevents node data leakage between test suites - Fixes all 4 hierarchy service test failures - Also fixes performance test failure (getVisibleNodes) Fixes #233 (partial - 5 of 14 failures fixed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
9 tasks
This commit resolves all remaining test failures from issue #233, bringing the total fixes to 14/14 tests (100% complete). ## Fixes ### 1. Node Operations Tests (3 failures) - FIXED **Root Cause**: Event-driven content reprocessing overwrote manually-set mentions **Problem**: - updateNodeMentions() set mentions to ['root2'] - SharedNodeStore.updateNode() emitted event with updateType: 'content' - Event triggered processContentMentions() which re-extracted from content - Re-extracted mentions (empty) overwrote the manual setting **Solution**: - Modified SharedNodeStore.updateNode() to intelligently set updateType - When ONLY mentions change: updateType = 'metadata' (not 'content') - Prevents content reprocessing from overwriting manual mentions - Added skipConflictDetection for mentions (computed field) **Files**: - src/lib/services/shared-node-store.ts - src/lib/services/reactive-node-service.svelte.ts ### 2. Slash Command Integration Tests (5 failures) - FIXED **Root Cause**: Vitest module duplication created two plugin registry instances **Problem**: - Global setup (Node context) registered plugins to instance #1 - Tests (Happy-DOM context) accessed instance #2 with 0 plugins - Vite creates separate module graphs for different contexts - Even globalThis singleton couldn't bridge the gap **Solution** (Credit: frontend-architect agent): - Moved plugin registration from global-setup.ts → setup.ts - Setup files run in SAME context (Happy-DOM) as tests - Single registry instance shared across all code - Real integration testing without mocks **Files**: - src/tests/setup.ts - Added plugin registration - src/tests/global-setup.ts - Removed registration, added docs - src/lib/plugins/plugin-registry.ts - Proper TypeScript types - src/lib/components/viewers/index.ts - Removed duplicate registration **Documentation**: - Added comprehensive lesson learned doc explaining the issue ### 3. SharedNodeStore Test (1 failure) - FIXED **Root Cause**: Test used viewer source but expected persistence **Problem**: - Test called updateNode() with viewerSource for content change - Architecture: viewer content changes DON'T persist immediately - BaseNodeViewer handles debouncing for viewer sources - Test incorrectly expected immediate persistence **Solution**: - Changed test to use external source instead of viewer source - External sources trigger proper debounced persistence - Test now correctly validates the persistence flow **Files**: - src/tests/services/shared-node-store.test.ts ## Architecture Compliance All fixes maintain proper architecture: ✅ Always use PersistenceCoordinator (no direct database calls) ✅ Event-driven updates with correct updateType ✅ Real integration testing (no mocks for core services) ✅ Proper separation of concerns (viewer vs external sources) ## Test Results Before: 14 test failures across 6 test files After: 0 test failures - ALL TESTS PASSING (100%) - ✅ Node Operations: 28/28 tests passing - ✅ Slash Commands: 6/6 tests passing - ✅ SharedNodeStore: 52/52 tests passing - ✅ Hierarchy Service: 22/22 tests passing (from PR #257) - ✅ Performance Tests: All passing (from PR #257) - ✅ Node Ordering: 8/8 tests passing (already fixed) ## Quality Checks ✅ bun run quality:fix - All checks passing ✅ No lint errors or warnings ✅ Type checking passing ✅ Rust formatting and clippy passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This commit implements all recommendations from the pragmatic code review, including the optional/nice-to-have improvements. ## Changes ### 1. Extract determineUpdateType() Logic - Added private methods `determineUpdateType()` and `isMetadataOnlyUpdate()` - Improves testability and maintainability - Makes it easier to add new computed fields in the future - Files: `shared-node-store.ts` ### 2. Add isComputedField Flag - Added `isComputedField` flag to `UpdateOptions` interface - Automatically sets skipPersistence=true and skipConflictDetection=true - Makes intent explicit when updating computed/derived fields - Updated `updateNodeMentions()` to use the new flag - Files: `update-protocol.ts`, `shared-node-store.ts`, `reactive-node-service.svelte.ts` ### 3. Simplify Plugin Registry Singleton - Removed globalThis pattern (didn't solve duplication anyway) - Now uses simple module-level export - Clearer comments explaining Vitest context separation - Files: `plugin-registry.ts` ### 4. Add Table of Contents to Documentation - Added comprehensive TOC to vitest-module-duplication-fix.md - Improves navigation for the 257-line document - Files: `vitest-module-duplication-fix.md` ### 5. Improve Plugin Registration Error Handling - Added try-catch around plugin registration in setup.ts - Better error messages for debugging - Fail-fast behavior ensures tests can't run without plugins - Files: `setup.ts` ### 6. Add Testing Pattern to Main Documentation - Added "CRITICAL: Vitest Setup File Pattern" section to testing-guide.md - Explains when to use setupFiles vs globalSetup - Includes correct and wrong patterns with examples - Links to detailed lesson learned document - Files: `testing-guide.md` ### 7. Create Follow-up Issue - Created issue #258 for SharedNodeStore unhandled rejection errors - Documents the 966 unhandled promise rejections from cancelPending() - Not blocking for this PR (pre-existing issue) ## Quality Checks ✅ All lint/format checks passing ✅ Type checking passing ✅ Rust formatting and clippy passing ✅ No breaking changes ## Related Issues - Implements all recommendations from pragmatic-code-review of #233 - Creates follow-up issue #258 for test infrastructure improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 4, 2026
…% complete) (#257) * Fix hierarchy service tests by resetting SharedNodeStore between tests - Added sharedNodeStore.__resetForTesting() to global beforeEach in setup.ts - Prevents node data leakage between test suites - Fixes all 4 hierarchy service test failures - Also fixes performance test failure (getVisibleNodes) Fixes #233 (partial - 5 of 14 failures fixed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix all 9 remaining UI & service integration test failures This commit resolves all remaining test failures from issue #233, bringing the total fixes to 14/14 tests (100% complete). ## Fixes ### 1. Node Operations Tests (3 failures) - FIXED **Root Cause**: Event-driven content reprocessing overwrote manually-set mentions **Problem**: - updateNodeMentions() set mentions to ['root2'] - SharedNodeStore.updateNode() emitted event with updateType: 'content' - Event triggered processContentMentions() which re-extracted from content - Re-extracted mentions (empty) overwrote the manual setting **Solution**: - Modified SharedNodeStore.updateNode() to intelligently set updateType - When ONLY mentions change: updateType = 'metadata' (not 'content') - Prevents content reprocessing from overwriting manual mentions - Added skipConflictDetection for mentions (computed field) **Files**: - src/lib/services/shared-node-store.ts - src/lib/services/reactive-node-service.svelte.ts ### 2. Slash Command Integration Tests (5 failures) - FIXED **Root Cause**: Vitest module duplication created two plugin registry instances **Problem**: - Global setup (Node context) registered plugins to instance #1 - Tests (Happy-DOM context) accessed instance #2 with 0 plugins - Vite creates separate module graphs for different contexts - Even globalThis singleton couldn't bridge the gap **Solution** (Credit: frontend-architect agent): - Moved plugin registration from global-setup.ts → setup.ts - Setup files run in SAME context (Happy-DOM) as tests - Single registry instance shared across all code - Real integration testing without mocks **Files**: - src/tests/setup.ts - Added plugin registration - src/tests/global-setup.ts - Removed registration, added docs - src/lib/plugins/plugin-registry.ts - Proper TypeScript types - src/lib/components/viewers/index.ts - Removed duplicate registration **Documentation**: - Added comprehensive lesson learned doc explaining the issue ### 3. SharedNodeStore Test (1 failure) - FIXED **Root Cause**: Test used viewer source but expected persistence **Problem**: - Test called updateNode() with viewerSource for content change - Architecture: viewer content changes DON'T persist immediately - BaseNodeViewer handles debouncing for viewer sources - Test incorrectly expected immediate persistence **Solution**: - Changed test to use external source instead of viewer source - External sources trigger proper debounced persistence - Test now correctly validates the persistence flow **Files**: - src/tests/services/shared-node-store.test.ts ## Architecture Compliance All fixes maintain proper architecture: ✅ Always use PersistenceCoordinator (no direct database calls) ✅ Event-driven updates with correct updateType ✅ Real integration testing (no mocks for core services) ✅ Proper separation of concerns (viewer vs external sources) ## Test Results Before: 14 test failures across 6 test files After: 0 test failures - ALL TESTS PASSING (100%) - ✅ Node Operations: 28/28 tests passing - ✅ Slash Commands: 6/6 tests passing - ✅ SharedNodeStore: 52/52 tests passing - ✅ Hierarchy Service: 22/22 tests passing (from PR #257) - ✅ Performance Tests: All passing (from PR #257) - ✅ Node Ordering: 8/8 tests passing (already fixed) ## Quality Checks ✅ bun run quality:fix - All checks passing ✅ No lint errors or warnings ✅ Type checking passing ✅ Rust formatting and clippy passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement code review recommendations for issue #233 This commit implements all recommendations from the pragmatic code review, including the optional/nice-to-have improvements. ## Changes ### 1. Extract determineUpdateType() Logic - Added private methods `determineUpdateType()` and `isMetadataOnlyUpdate()` - Improves testability and maintainability - Makes it easier to add new computed fields in the future - Files: `shared-node-store.ts` ### 2. Add isComputedField Flag - Added `isComputedField` flag to `UpdateOptions` interface - Automatically sets skipPersistence=true and skipConflictDetection=true - Makes intent explicit when updating computed/derived fields - Updated `updateNodeMentions()` to use the new flag - Files: `update-protocol.ts`, `shared-node-store.ts`, `reactive-node-service.svelte.ts` ### 3. Simplify Plugin Registry Singleton - Removed globalThis pattern (didn't solve duplication anyway) - Now uses simple module-level export - Clearer comments explaining Vitest context separation - Files: `plugin-registry.ts` ### 4. Add Table of Contents to Documentation - Added comprehensive TOC to vitest-module-duplication-fix.md - Improves navigation for the 257-line document - Files: `vitest-module-duplication-fix.md` ### 5. Improve Plugin Registration Error Handling - Added try-catch around plugin registration in setup.ts - Better error messages for debugging - Fail-fast behavior ensures tests can't run without plugins - Files: `setup.ts` ### 6. Add Testing Pattern to Main Documentation - Added "CRITICAL: Vitest Setup File Pattern" section to testing-guide.md - Explains when to use setupFiles vs globalSetup - Includes correct and wrong patterns with examples - Links to detailed lesson learned document - Files: `testing-guide.md` ### 7. Create Follow-up Issue - Created issue #258 for SharedNodeStore unhandled rejection errors - Documents the 966 unhandled promise rejections from cancelPending() - Not blocking for this PR (pre-existing issue) ## Quality Checks ✅ All lint/format checks passing ✅ Type checking passing ✅ Rust formatting and clippy passing ✅ No breaking changes ## Related Issues - Implements all recommendations from pragmatic-code-review of #233 - Creates follow-up issue #258 for test infrastructure improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 5, 2026
…% complete) (#257) * Fix hierarchy service tests by resetting SharedNodeStore between tests - Added sharedNodeStore.__resetForTesting() to global beforeEach in setup.ts - Prevents node data leakage between test suites - Fixes all 4 hierarchy service test failures - Also fixes performance test failure (getVisibleNodes) Fixes #233 (partial - 5 of 14 failures fixed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix all 9 remaining UI & service integration test failures This commit resolves all remaining test failures from issue #233, bringing the total fixes to 14/14 tests (100% complete). ## Fixes ### 1. Node Operations Tests (3 failures) - FIXED **Root Cause**: Event-driven content reprocessing overwrote manually-set mentions **Problem**: - updateNodeMentions() set mentions to ['root2'] - SharedNodeStore.updateNode() emitted event with updateType: 'content' - Event triggered processContentMentions() which re-extracted from content - Re-extracted mentions (empty) overwrote the manual setting **Solution**: - Modified SharedNodeStore.updateNode() to intelligently set updateType - When ONLY mentions change: updateType = 'metadata' (not 'content') - Prevents content reprocessing from overwriting manual mentions - Added skipConflictDetection for mentions (computed field) **Files**: - src/lib/services/shared-node-store.ts - src/lib/services/reactive-node-service.svelte.ts ### 2. Slash Command Integration Tests (5 failures) - FIXED **Root Cause**: Vitest module duplication created two plugin registry instances **Problem**: - Global setup (Node context) registered plugins to instance #1 - Tests (Happy-DOM context) accessed instance #2 with 0 plugins - Vite creates separate module graphs for different contexts - Even globalThis singleton couldn't bridge the gap **Solution** (Credit: frontend-architect agent): - Moved plugin registration from global-setup.ts → setup.ts - Setup files run in SAME context (Happy-DOM) as tests - Single registry instance shared across all code - Real integration testing without mocks **Files**: - src/tests/setup.ts - Added plugin registration - src/tests/global-setup.ts - Removed registration, added docs - src/lib/plugins/plugin-registry.ts - Proper TypeScript types - src/lib/components/viewers/index.ts - Removed duplicate registration **Documentation**: - Added comprehensive lesson learned doc explaining the issue ### 3. SharedNodeStore Test (1 failure) - FIXED **Root Cause**: Test used viewer source but expected persistence **Problem**: - Test called updateNode() with viewerSource for content change - Architecture: viewer content changes DON'T persist immediately - BaseNodeViewer handles debouncing for viewer sources - Test incorrectly expected immediate persistence **Solution**: - Changed test to use external source instead of viewer source - External sources trigger proper debounced persistence - Test now correctly validates the persistence flow **Files**: - src/tests/services/shared-node-store.test.ts ## Architecture Compliance All fixes maintain proper architecture: ✅ Always use PersistenceCoordinator (no direct database calls) ✅ Event-driven updates with correct updateType ✅ Real integration testing (no mocks for core services) ✅ Proper separation of concerns (viewer vs external sources) ## Test Results Before: 14 test failures across 6 test files After: 0 test failures - ALL TESTS PASSING (100%) - ✅ Node Operations: 28/28 tests passing - ✅ Slash Commands: 6/6 tests passing - ✅ SharedNodeStore: 52/52 tests passing - ✅ Hierarchy Service: 22/22 tests passing (from PR #257) - ✅ Performance Tests: All passing (from PR #257) - ✅ Node Ordering: 8/8 tests passing (already fixed) ## Quality Checks ✅ bun run quality:fix - All checks passing ✅ No lint errors or warnings ✅ Type checking passing ✅ Rust formatting and clippy passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement code review recommendations for issue #233 This commit implements all recommendations from the pragmatic code review, including the optional/nice-to-have improvements. ## Changes ### 1. Extract determineUpdateType() Logic - Added private methods `determineUpdateType()` and `isMetadataOnlyUpdate()` - Improves testability and maintainability - Makes it easier to add new computed fields in the future - Files: `shared-node-store.ts` ### 2. Add isComputedField Flag - Added `isComputedField` flag to `UpdateOptions` interface - Automatically sets skipPersistence=true and skipConflictDetection=true - Makes intent explicit when updating computed/derived fields - Updated `updateNodeMentions()` to use the new flag - Files: `update-protocol.ts`, `shared-node-store.ts`, `reactive-node-service.svelte.ts` ### 3. Simplify Plugin Registry Singleton - Removed globalThis pattern (didn't solve duplication anyway) - Now uses simple module-level export - Clearer comments explaining Vitest context separation - Files: `plugin-registry.ts` ### 4. Add Table of Contents to Documentation - Added comprehensive TOC to vitest-module-duplication-fix.md - Improves navigation for the 257-line document - Files: `vitest-module-duplication-fix.md` ### 5. Improve Plugin Registration Error Handling - Added try-catch around plugin registration in setup.ts - Better error messages for debugging - Fail-fast behavior ensures tests can't run without plugins - Files: `setup.ts` ### 6. Add Testing Pattern to Main Documentation - Added "CRITICAL: Vitest Setup File Pattern" section to testing-guide.md - Explains when to use setupFiles vs globalSetup - Includes correct and wrong patterns with examples - Links to detailed lesson learned document - Files: `testing-guide.md` ### 7. Create Follow-up Issue - Created issue #258 for SharedNodeStore unhandled rejection errors - Documents the 966 unhandled promise rejections from cancelPending() - Not blocking for this PR (pre-existing issue) ## Quality Checks ✅ All lint/format checks passing ✅ Type checking passing ✅ Rust formatting and clippy passing ✅ No breaking changes ## Related Issues - Implements all recommendations from pragmatic-code-review of #233 - Creates follow-up issue #258 for test infrastructure improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 26, 2026
…% complete) (#257) * Fix hierarchy service tests by resetting SharedNodeStore between tests - Added sharedNodeStore.__resetForTesting() to global beforeEach in setup.ts - Prevents node data leakage between test suites - Fixes all 4 hierarchy service test failures - Also fixes performance test failure (getVisibleNodes) Fixes #233 (partial - 5 of 14 failures fixed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix all 9 remaining UI & service integration test failures This commit resolves all remaining test failures from issue #233, bringing the total fixes to 14/14 tests (100% complete). ## Fixes ### 1. Node Operations Tests (3 failures) - FIXED **Root Cause**: Event-driven content reprocessing overwrote manually-set mentions **Problem**: - updateNodeMentions() set mentions to ['root2'] - SharedNodeStore.updateNode() emitted event with updateType: 'content' - Event triggered processContentMentions() which re-extracted from content - Re-extracted mentions (empty) overwrote the manual setting **Solution**: - Modified SharedNodeStore.updateNode() to intelligently set updateType - When ONLY mentions change: updateType = 'metadata' (not 'content') - Prevents content reprocessing from overwriting manual mentions - Added skipConflictDetection for mentions (computed field) **Files**: - src/lib/services/shared-node-store.ts - src/lib/services/reactive-node-service.svelte.ts ### 2. Slash Command Integration Tests (5 failures) - FIXED **Root Cause**: Vitest module duplication created two plugin registry instances **Problem**: - Global setup (Node context) registered plugins to instance #1 - Tests (Happy-DOM context) accessed instance #2 with 0 plugins - Vite creates separate module graphs for different contexts - Even globalThis singleton couldn't bridge the gap **Solution** (Credit: frontend-architect agent): - Moved plugin registration from global-setup.ts → setup.ts - Setup files run in SAME context (Happy-DOM) as tests - Single registry instance shared across all code - Real integration testing without mocks **Files**: - src/tests/setup.ts - Added plugin registration - src/tests/global-setup.ts - Removed registration, added docs - src/lib/plugins/plugin-registry.ts - Proper TypeScript types - src/lib/components/viewers/index.ts - Removed duplicate registration **Documentation**: - Added comprehensive lesson learned doc explaining the issue ### 3. SharedNodeStore Test (1 failure) - FIXED **Root Cause**: Test used viewer source but expected persistence **Problem**: - Test called updateNode() with viewerSource for content change - Architecture: viewer content changes DON'T persist immediately - BaseNodeViewer handles debouncing for viewer sources - Test incorrectly expected immediate persistence **Solution**: - Changed test to use external source instead of viewer source - External sources trigger proper debounced persistence - Test now correctly validates the persistence flow **Files**: - src/tests/services/shared-node-store.test.ts ## Architecture Compliance All fixes maintain proper architecture: ✅ Always use PersistenceCoordinator (no direct database calls) ✅ Event-driven updates with correct updateType ✅ Real integration testing (no mocks for core services) ✅ Proper separation of concerns (viewer vs external sources) ## Test Results Before: 14 test failures across 6 test files After: 0 test failures - ALL TESTS PASSING (100%) - ✅ Node Operations: 28/28 tests passing - ✅ Slash Commands: 6/6 tests passing - ✅ SharedNodeStore: 52/52 tests passing - ✅ Hierarchy Service: 22/22 tests passing (from PR #257) - ✅ Performance Tests: All passing (from PR #257) - ✅ Node Ordering: 8/8 tests passing (already fixed) ## Quality Checks ✅ bun run quality:fix - All checks passing ✅ No lint errors or warnings ✅ Type checking passing ✅ Rust formatting and clippy passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement code review recommendations for issue #233 This commit implements all recommendations from the pragmatic code review, including the optional/nice-to-have improvements. ## Changes ### 1. Extract determineUpdateType() Logic - Added private methods `determineUpdateType()` and `isMetadataOnlyUpdate()` - Improves testability and maintainability - Makes it easier to add new computed fields in the future - Files: `shared-node-store.ts` ### 2. Add isComputedField Flag - Added `isComputedField` flag to `UpdateOptions` interface - Automatically sets skipPersistence=true and skipConflictDetection=true - Makes intent explicit when updating computed/derived fields - Updated `updateNodeMentions()` to use the new flag - Files: `update-protocol.ts`, `shared-node-store.ts`, `reactive-node-service.svelte.ts` ### 3. Simplify Plugin Registry Singleton - Removed globalThis pattern (didn't solve duplication anyway) - Now uses simple module-level export - Clearer comments explaining Vitest context separation - Files: `plugin-registry.ts` ### 4. Add Table of Contents to Documentation - Added comprehensive TOC to vitest-module-duplication-fix.md - Improves navigation for the 257-line document - Files: `vitest-module-duplication-fix.md` ### 5. Improve Plugin Registration Error Handling - Added try-catch around plugin registration in setup.ts - Better error messages for debugging - Fail-fast behavior ensures tests can't run without plugins - Files: `setup.ts` ### 6. Add Testing Pattern to Main Documentation - Added "CRITICAL: Vitest Setup File Pattern" section to testing-guide.md - Explains when to use setupFiles vs globalSetup - Includes correct and wrong patterns with examples - Links to detailed lesson learned document - Files: `testing-guide.md` ### 7. Create Follow-up Issue - Created issue #258 for SharedNodeStore unhandled rejection errors - Documents the 966 unhandled promise rejections from cancelPending() - Not blocking for this PR (pre-existing issue) ## Quality Checks ✅ All lint/format checks passing ✅ Type checking passing ✅ Rust formatting and clippy passing ✅ No breaking changes ## Related Issues - Implements all recommendations from pragmatic-code-review of #233 - Creates follow-up issue #258 for test infrastructure improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
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
Fixed all 14 test failures from issue #233 by addressing three distinct root causes:
Test Results - ALL PASSING ✅
Before: 14 test failures across 6 test files
After: 0 test failures - 100% complete
Fixes
1. Node Operations Tests (3 failures) - FIXED
Root Cause: Event-driven content reprocessing overwrote manually-set mentions
Problem:
updateNodeMentions()set mentions to['root2']SharedNodeStore.updateNode()emitted event withupdateType: 'content'processContentMentions()which re-extracted from content (empty)Solution:
SharedNodeStore.updateNode()to intelligently setupdateTypeupdateType = 'metadata'(not'content')skipConflictDetection: truefor mentions (computed field)Files Changed:
src/lib/services/shared-node-store.tssrc/lib/services/reactive-node-service.svelte.ts2. Slash Command Integration Tests (5 failures) - FIXED
Root Cause: Vitest module duplication created two plugin registry instances
Problem:
globalThissingleton couldn't bridge the context gapSolution (Credit: @frontend-architect agent):
global-setup.ts→setup.tsFiles Changed:
src/tests/setup.ts- Added plugin registrationsrc/tests/global-setup.ts- Removed registration, added documentationsrc/lib/plugins/plugin-registry.ts- Proper TypeScript typessrc/lib/components/viewers/index.ts- Removed duplicate registrationDocumentation:
docs/architecture/development/lessons/vitest-module-duplication-fix.md- Complete analysis and solution3. SharedNodeStore Test (1 failure) - FIXED
Root Cause: Test used viewer source but expected persistence
Problem:
updateNode()withviewerSourcefor content changeBaseNodeViewerhandles debouncing for viewer sourcesSolution:
externalsource instead ofviewersourceFiles Changed:
src/tests/services/shared-node-store.test.tsArchitecture Compliance
All fixes maintain proper architecture:
Quality Checks
bun run quality:fix- All checks passingTest Plan
All test suites pass:
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]