Skip to content

fix(dashboard): settle multi-select Other before input#2302

Merged
gsxdsm merged 1 commit into
mainfrom
fix/main-tests-v20
Jul 18, 2026
Merged

fix(dashboard): settle multi-select Other before input#2302
gsxdsm merged 1 commit into
mainfrom
fix/main-tests-v20

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Full Suite 29646721723 shard 3: multi-select Other-only timed out on planning-other-input.
  • Wait for Other checkbox toBeChecked(), then findByTestId; apply same settle to remaining Other paths.

Test plan

  • Other-only multi/single-select + clear/confirm/checkpoint Other tests
  • Full Suite all 4 shards green on main

Summary by CodeRabbit

  • Tests
    • Improved planning-flow test reliability by waiting for “Other” inputs and selections to be ready before interacting with them.
    • Updated assertions to account for UI state settling during multi-select and confirmation flows.

Full Suite shard 3 failed Other-only multi-select when checkbox click did not
commit isOtherSelected before findByTestId under CI load. Wait for checked
state and apply findByTestId across remaining Other planning-flow paths.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated PlanningModeModal planning-flow tests to await asynchronously rendered Other inputs, verify checkbox state before assertions, and validate Continue-button behavior after text changes.

Changes

Planning mode test synchronization

Layer / File(s) Summary
Synchronize Other-option test flows
packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx
Tests await the Other input before editing or asserting, verify the multi-select checkbox is checked, and confirm Continue-button behavior for empty and non-empty Other text.

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

Possibly related PRs

  • Runfusion/Fusion#2295: Updates the same planning-flow tests with async settling for mobile multi-select Other interactions.
  • Runfusion/Fusion#2299: Updates the same tests to await the Other input in the confirm-flow path.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main test-fix change: waiting for the multi-select “Other” state to settle before interacting with its input.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/main-tests-v20

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 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR changes how planning-flow tests wait for the conditional Other input.

  • Replaces synchronous input queries with findByTestId.
  • Waits for the multi-select Other checkbox to become checked.
  • Reuses the settled input across clear and confirm flows.

Confidence Score: 5/5

The test behavior remains covered, but the documented flaky case must follow the repository's quarantine process.

  • The new waits still fail when the Other input never appears.
  • Existing answer and button-state assertions remain intact.
  • The explicit polling conflicts with the quarantine-on-sight rule for observed flakes.

packages/dashboard/app/components/tests/PlanningModeModal.planning-flow.test.tsx

Important Files Changed

Filename Overview
packages/dashboard/app/components/tests/PlanningModeModal.planning-flow.test.tsx Adds asynchronous settling to several Other-option tests while leaving an observed flaky test outside the required quarantine process.

Reviews (1): Last reviewed commit: "fix(dashboard): settle multi-select Othe..." | Re-trigger Greptile

*/
const otherCheckbox = within(screen.getByTestId("planning-option-other")).getByRole("checkbox");
fireEvent.click(otherCheckbox);
await waitFor(() => expect(otherCheckbox).toBeChecked());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Flake Bypasses Quarantine Ratchet

The linked CI timeout is handled by adding polling through waitFor and findByTestId. AGENTS.md lines 144–151 prohibit retries or stabilization waits for observed flaky tests and require quarantine with the failing run instead, so this leaves the known flake active outside the repository's required quarantine process.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx`:
- Around line 706-714: Quarantine the flaky planning-flow test by adding the
required ledger entry and matching Vitest exclusion, rather than using polling
retries. In
packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx
lines 706-714, remove waitFor and restore synchronous checkbox validation before
applying the test exclusion. At lines 359, 607, 646-649, and 906-907 of the same
file, replace findByTestId with getByTestId and remove await; these sites are
part of the same deterministic test cleanup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3038fbc9-bcf9-4469-8d77-1a023449685c

📥 Commits

Reviewing files that changed from the base of the PR and between 9f8be56 and ee59016.

📒 Files selected for processing (1)
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx

Comment on lines +706 to +714
FNXC:PlanningModeOptions 2026-07-18-14:00:
Full Suite shard 3 (29646721723) timed out finding planning-other-input after a bare
checkbox click under CI load. Wait for the multi-select Other checkbox to be checked,
then findByTestId the input (extends FN-8245 settle discipline).
*/
const otherCheckbox = within(screen.getByTestId("planning-option-other")).getByRole("checkbox");
fireEvent.click(otherCheckbox);
await waitFor(() => expect(otherCheckbox).toBeChecked());
expect(continueButton).toBeDisabled();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Quarantine flaky tests instead of appeasing them with polling loops.

The FNXC comment at this anchor explicitly states these changes address a CI timeout by introducing waitFor and findByTestId. However, findByTestId and waitFor rely on polling loops and retries under the hood. As per coding guidelines, you must "Quarantine flaky tests immediately by adding the required ledger entry and matching Vitest exclusion in the same commit. Never appease flakes with larger timeouts, retries... do not add... polling loops".

Because fireEvent flushes plain React state updates synchronously via act(), getByTestId is the correct deterministic approach; the CI timeout reveals a true underlying flake (such as test bleed or environment resource starvation) that must be quarantined rather than masked.

  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L706-L714: Remove the waitFor retry, revert to synchronous state validation, and quarantine the test (e.g., via a .skip exclusion and a ledger entry).
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L359-L359: Revert findByTestId back to the synchronous getByTestId and remove await.
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L607-L607: Revert findByTestId back to the synchronous getByTestId and remove await.
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L646-L649: Revert findByTestId back to the synchronous getByTestId and remove await.
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L906-L907: Revert findByTestId back to the synchronous getByTestId and remove await.
📍 Affects 1 file
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L706-L714 (this comment)
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L359-L359
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L607-L607
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L646-L649
  • packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx#L906-L907
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx`
around lines 706 - 714, Quarantine the flaky planning-flow test by adding the
required ledger entry and matching Vitest exclusion, rather than using polling
retries. In
packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx
lines 706-714, remove waitFor and restore synchronous checkbox validation before
applying the test exclusion. At lines 359, 607, 646-649, and 906-907 of the same
file, replace findByTestId with getByTestId and remove await; these sites are
part of the same deterministic test cleanup.

Source: Coding guidelines

@gsxdsm
gsxdsm merged commit 825e6c1 into main Jul 18, 2026
7 checks passed
@gsxdsm
gsxdsm deleted the fix/main-tests-v20 branch July 18, 2026 14:17
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