Skip to content

test: fix TaskCard/GraphTaskNode useToast + TaskDetailModal CSS selector-list regex (round 3)#1969

Merged
gsxdsm merged 2 commits into
mainfrom
fix/full-suite-round3
Jul 9, 2026
Merged

test: fix TaskCard/GraphTaskNode useToast + TaskDetailModal CSS selector-list regex (round 3)#1969
gsxdsm merged 2 commits into
mainfrom
fix/full-suite-round3

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

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/footer tests (TaskCard.badge-height, TaskCard.badge-wrap, TaskCard.footer-wrap) — RuntimeFallbackBadge now calls the dashboard useToast() hook, but these suites render <TaskCard> without a ToastProvider. Added the useToast mock (same pattern as the sibling TaskCard.test.tsx and PlanningModeModal suites).
  • 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.
  • GraphTaskNode tests (fusion-plugin-dependency-graph) — same useToast issue: GraphTaskNode renders the REAL TaskCard (to verify prop pass-through, unlike sibling suites that mock it), hitting RuntimeFallbackBadgeuseToast. Added the @fusion/dashboard/app/hooks/useToast mock 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

  • TaskCard badge/footer: 14/14 ✅
  • TaskDetailModal.github-tracking-header: 1/1 ✅
  • GraphTaskNode + GraphTaskNode.drag: 29/29 ✅

Summary by CodeRabbit

  • Tests
    • Stabilized several dashboard and dependency-graph test suites by mocking toast behavior to prevent provider-related failures.
    • Improved robustness of task card and graph node interaction tests.
    • Updated task detail modal CSS/layout assertions to better align with current responsive styling and selector patterns.
    • Reduced test flakiness for step-session retry timing by using controlled fake-timer advancement.

…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)
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0fc2bc20-14a0-4076-a3c8-1b5995ffc162

📥 Commits

Reviewing files that changed from the base of the PR and between dc54acd and c74c5f6.

📒 Files selected for processing (1)
  • packages/engine/src/__tests__/step-session-executor.test.ts

📝 Walkthrough

Walkthrough

Test files now mock useToast for TaskCard and GraphTaskNode rendering, one CSS assertion tolerates consolidated selector lists, and one engine test advances fake timers before awaiting workflow execution.

Changes

useToast mocking, CSS assertion, and timing update

Layer / File(s) Summary
TaskCard test useToast mocks
packages/dashboard/app/components/__tests__/TaskCard.badge-height.test.tsx, packages/dashboard/app/components/__tests__/TaskCard.badge-wrap.test.tsx, packages/dashboard/app/components/__tests__/TaskCard.footer-wrap.test.tsx
Added vi.mock blocks for ../../hooks/useToast stubbing addToast, removeToast, and toasts.
GraphTaskNode test useToast mocks
plugins/fusion-plugin-dependency-graph/src/__tests__/GraphTaskNode.drag.test.tsx, plugins/fusion-plugin-dependency-graph/src/__tests__/GraphTaskNode.test.tsx
Added vi.mock blocks for @fusion/dashboard/app/hooks/useToast with comments about the missing ToastProvider context.
GitHub tracking header CSS regex update
packages/dashboard/app/components/__tests__/TaskDetailModal.github-tracking-header.test.tsx
Adjusted CSS matching regex to allow selector-list text before the opening brace for desktop and mobile assertions.
Step session executor retry timing
packages/engine/src/__tests__/step-session-executor.test.ts
Changed the failed-step test to run executeAll() asynchronously, advance fake timers by 60 seconds, and then await the stored promise.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • Runfusion/Fusion#1962 — Also addresses test failures caused by useToast-dependent components in dashboard and dependency-graph test environments.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main test-only fixes: useToast mocks and the TaskDetailModal selector-list regex update.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/full-suite-round3

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a test-only PR that fixes six test suites which broke due to post-#1965 production changes: RuntimeFallbackBadge now calls useToast(), and CSS tracking-header rules were consolidated into shared selector lists. No production code is changed.

  • useToast mock added to three TaskCard badge/footer suites and both GraphTaskNode suites — identical pattern to existing sibling suites, resolving the "useToast must be used within ToastProvider" error when rendering the real TaskCard without a provider.
  • CSS regex relaxation in TaskDetailModal.github-tracking-header: \s*\{[^{]*\{ on all three patterns to tolerate shared selector lists, while still pinning flex-wrap, align-items, and min-width layout properties.
  • Engine timer fix in step-session-executor.test.ts: converts a direct await executor.executeAll() to the deferred-promise + vi.advanceTimersByTimeAsync(60_000) pattern, skipping the real-wall-clock sleep delays that were inflating CI shard time to ~22.6 s per run.

Confidence Score: 5/5

All 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

Filename Overview
packages/dashboard/app/components/tests/TaskCard.badge-height.test.tsx Adds useToast mock identical to the sibling TaskCard.test.tsx pattern; cleanly fixes the missing ToastProvider error.
packages/dashboard/app/components/tests/TaskCard.badge-wrap.test.tsx Same useToast mock addition as badge-height; straightforward and consistent with the established pattern.
packages/dashboard/app/components/tests/TaskCard.footer-wrap.test.tsx Same useToast mock addition; correctly placed after the existing useConfirm mock.
packages/dashboard/app/components/tests/TaskDetailModal.github-tracking-header.test.tsx Updates three CSS regex patterns from \s*{ to [^{]*{ to tolerate shared selector lists; still pins all layout properties.
packages/engine/src/tests/step-session-executor.test.ts Converts await executor.executeAll() to a deferred-resolve pattern with vi.advanceTimersByTimeAsync(60_000), correctly bypassing real-wall-clock sleep delays while keeping assertions valid.
plugins/fusion-plugin-dependency-graph/src/tests/GraphTaskNode.drag.test.tsx Adds useToast mock at the top of the file; correctly isolated from the real ToastProvider.
plugins/fusion-plugin-dependency-graph/src/tests/GraphTaskNode.test.tsx Adds useToast mock for the real-TaskCard rendering path; comment explains why this file needs it while sibling suites that mock TaskCard do not.

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.
@gsxdsm gsxdsm merged commit 0faf4ed into main Jul 9, 2026
7 checks passed
@gsxdsm gsxdsm deleted the fix/full-suite-round3 branch July 9, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant