Repository navigation
test: finish sidebar lazy imports before teardown - #23694
Conversation
|
Warning Review limit reachedNext included review available in 9 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Awaits pending lazy imports in test teardown —
afterEachnow callsawait vi.dynamicImportSettled()after unmounting the mounted roots, so the lazily imported./CommentMarkdownchunk resolves before the happy-dom module environment is torn down.
The fix is correct and well targeted. This test renders the real WorktreeCardAgents, which pull in DashboardAgentRowMessage → CommentMarkdownAsync (comment-markdown-lazy.tsx), whose effect calls preloadCommentMarkdown() (void import('./CommentMarkdown')). That chunk's evaluation racing environment teardown is exactly what vi.dynamicImportSettled() is for, and it exists in the installed Vitest ^4.1.11. vi is already imported, and the call sits correctly after unmount inside the existing act. No other test appears to exercise this markdown path, so there is no broader cleanup gap to flag.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|

ELI5
A sidebar test could pass all assertions but still fail CI because its markdown import finished after the test environment had been destroyed.
What Changed
Wait for pending dynamic imports during the existing cleanup, after unmounting the cards.
Why
The real agent rows start a lazy markdown import. Waiting for that work keeps the real components and all expansion assertions, without hiding imports behind mocks or increasing timeouts.
Linked Issue
Related CI failure on #23691.
Visual Proof
N/A — test cleanup only.
Testing
Review
No application behavior changes; platform and SSH behavior are unchanged.
Agent skill upstream boundary
Checklist