test: fix TaskCard/GraphTaskNode useToast + TaskDetailModal CSS selector-list regex (round 3)#1969
Conversation
…tor-list regex - TaskCard badge/footer tests + GraphTaskNode tests: mock useToast (RuntimeFallbackBadge now calls it; tests render TaskCard without ToastProvider) - TaskDetailModal.github-tracking-header: allow selector-list form in CSS regex (github+gitlab tracking rules consolidated)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTest files now mock ChangesuseToast mocking, CSS assertion, and timing update
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis is a test-only PR that fixes six test suites which broke due to post-#1965 production changes:
Confidence Score: 5/5All changes are test-only; no production code is touched. Each fix is a minimal, targeted correction that matches established patterns in sibling test files. The useToast mocks are copy-identical to the existing TaskCard.test.tsx mock. The CSS regex relaxation is conservative — [^{]* still stops at the first {, so the property assertions remain binding. The engine timer pattern (deferred promise + advanceTimersByTimeAsync) is the standard Vitest approach for async-sleep loops and is correctly sized at 60 s, well above the observed ~22.6 s retry budget. No files require special attention — all changes are isolated to test helpers and assertions. Important Files Changed
Reviews (2): Last reviewed commit: "perf(test): fast-forward fake timers in ..." | Re-trigger Greptile |
…y test (was 22.6s real-time wait)
The 'publishes failed terminal workflow step activity' test awaited executeAll()
directly while the executor retried a failing step 3x with sleep() delays. Under
useFakeTimers({ shouldAdvanceTime: true }) those sleeps consumed REAL wall-clock
time (~22.6s locally, ballooning under CI load and busting the shard-2 watchdog).
Fast-forward the retry sleeps via vi.advanceTimersByTimeAsync like sibling retry
tests; the loop now completes in milliseconds.
Summary
Round 3 of full-suite greening on
main. The post-#1965 full-suite still failed on 6 UI/CSS test files in shards 3+4 (pre-existing test-drift from recent UI commits, surfaced after the chat/i18n fixes landed). All fixed.Fixes (all test-only; no production change)
TaskCard.badge-height,TaskCard.badge-wrap,TaskCard.footer-wrap) —RuntimeFallbackBadgenow calls the dashboarduseToast()hook, but these suites render<TaskCard>without aToastProvider. Added theuseToastmock (same pattern as the siblingTaskCard.test.tsxandPlanningModeModalsuites).TaskDetailModal.github-tracking-header— the github/gitlab tracking header CSS rules were consolidated into a shared selector list (.detail-github-tracking-section .detail-source-header, .detail-gitlab-tracking-section .detail-source-header {…}), so the test's\s*\{(selector immediately followed by{) no longer matched. Updated the 3 CSS regexes to[^{]*\{to tolerate the selector list while still pinning the layout contract.GraphTaskNodetests (fusion-plugin-dependency-graph) — sameuseToastissue:GraphTaskNoderenders the REALTaskCard(to verify prop pass-through, unlike sibling suites that mock it), hittingRuntimeFallbackBadge→useToast. Added the@fusion/dashboard/app/hooks/useToastmock to both files.Note on shard-2 engine[2/2]
Shard 2 still times out (watchdog 900s) on
@fusion/engine [2/2]. This is the engine-reliability real-git tier running single-threaded under 4-shard concurrent load — locally[2/2]is ~96s and green. It's slow-test-debt / CI-load, not a code bug in these commits; I'm investigating the specific slow/hanging file separately (the silent CI reporter hides it).Verification
Summary by CodeRabbit