Skip to content

test(header): repoint nav tests at the consolidated Trade group (3 failures on playground) - #2459

Open
dcccrypto wants to merge 3 commits into
playgroundfrom
fix/header-test-nav-consolidation
Open

test(header): repoint nav tests at the consolidated Trade group (3 failures on playground)#2459
dcccrypto wants to merge 3 commits into
playgroundfrom
fix/header-test-nav-consolidation

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

What broke

Header.test.tsx fails 3/3 on playground (5550a19d):

Unable to find an accessible element with the role "menuitem" and name `/Wallet/i`
  ✗ shows Wallet link inside Trade dropdown
  ✗ dismisses Trade dropdown on Escape
  ✗ dismisses Trade dropdown on outside click

Confirmed on the untouched base, so this is not from any open PR.

Why

The nav consolidation (5550a19d) slimmed the Trade group to Markets/Portfolio/Earn — Dashboard, Wallet, My Markets and Stake became tabs of the /portfolio and /earn hubs. Per that commit's own description, the old routes "stay working standalone"; they are simply no longer top-level dropdown entries.

That commit repointed Portfolio.test but not Header.test, which still probes for a Wallet menuitem.

Fix — two different situations, not one blanket rename

test what it actually asserts fix
shows Wallet link inside Trade dropdown a nav entry that was deliberately removed repointed to Portfolio → /portfolio, preserving the intent: an open dropdown exposes its links as menuitems with correct hrefs
dismisses … on Escape dismissal behaviour; Wallet was only a probe for open/closed probe swapped to Portfolio, behaviour assertions untouched
dismisses … on outside click same same

Verification — the dismissal tests still bind

Swapping a probe can quietly make a test vacuous, so I mutation-tested it:

state Escape / outside-click tests
fix applied pass
+ NavDropdown's if (e.key === 'Escape') setOpen(false) and its mousedown listener neutralised FAIL
restored pass

Full suite (app/) with the open test-repair PRs stacked: 2805 passed, 0 failed.

Note

Invisible to CI for the same reason as #2457/#2458 — see #2447: Unit Tests / Integration Tests / Coverage Gate report SKIPPED while the Merge Gate reports SUCCESS.

🤖 Generated with Claude Code

The nav consolidation (5550a19) slimmed the Trade dropdown to
Markets/Portfolio/Earn — Dashboard, Wallet, My Markets and Stake became tabs of
the /portfolio and /earn hubs. Their standalone routes still work; they are just
no longer top-level dropdown entries. That commit repointed Portfolio.test but
not Header.test, which still probed for a 'Wallet' menuitem and so failed 3/3:

  Unable to find an accessible element with the role "menuitem" and name /Wallet/i

Two different situations, fixed accordingly:
- 'shows Wallet link inside Trade dropdown' asserted a nav entry that was
  deliberately removed. Repointed to Portfolio -> /portfolio, keeping the real
  intent: the open dropdown exposes its links as menuitems with correct hrefs.
- The Escape and outside-click tests only used Wallet as a PROBE for
  open/closed; their subject is dismissal behaviour. Probe swapped to Portfolio,
  behaviour assertions untouched.

Verified the dismissal tests still bind, not just pass: neutralising
NavDropdown's `if (e.key === 'Escape') setOpen(false)` and its mousedown
listener makes both FAIL, and restoring them passes.
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
percolator-launch Ready Ready Preview, Comment Jul 26, 2026 5:19am
percolator-mainnet Ready Ready Preview, Comment Jul 26, 2026 5:19am
percolator-playground Ready Ready Preview, Comment Jul 26, 2026 5:19am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ff6734d4-2271-41f8-b776-271a15c243fb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/header-test-nav-consolidation

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.

…own left

Supersedes this branch's first commit. That one repointed the Trade-dropdown
probe from Wallet to Portfolio, which was correct for 5550a19 but is now wrong:
d6156f5 flattened the desktop nav and REMOVED the Trade and Build dropdowns
outright. On the new base all 4 nav tests fail with

  Unable to find an accessible element with the role "button" and name /Trade/i

New shape: Trade / Earn / Create a Market are plain links, Portfolio moved to the
right beside the wallet, and Community is the only remaining NavDropdown (it
absorbed Developers + Faucet from the old Build group).

Tests updated to match, keeping every behaviour that still exists:
- new 'renders the flat top-level links' pins Trade/Earn/Create/Portfolio as
  links with correct hrefs (coverage the old dropdown tests used to give).
- 'renders Community as the only dropdown trigger' also asserts Build is NOT a
  button any more, so a silent regression back to dropdowns would fail.
- open / Escape / outside-click now exercise Community — the same NavDropdown
  component, just the group that survived.

Mutation-verified, not merely passing:
- neutralising NavDropdown's Escape branch + its mousedown listener FAILS both
  dismissal tests; restoring passes.
- renaming the Portfolio link FAILS the flat-links test; restoring passes.
@dcccrypto

Copy link
Copy Markdown
Owner Author

Updated — the nav changed again under this PR

d6156f5c (feat(nav): flatten top nav) landed after I opened this, and it makes the original fix here wrong, so I've updated the branch rather than leave a misleading PR open.

What changed: that commit removed the Trade and Build dropdowns outright. My first commit repointed the Trade-dropdown probe from Wallet → Portfolio, which was right for 5550a19d but assumes a dropdown that no longer exists. On the new base all 4 nav tests fail, one more than before:

Unable to find an accessible element with the role "button" and name `/Trade/i`
  ✗ renders dropdown group triggers        ← newly failing
  ✗ shows … link inside Trade dropdown
  ✗ dismisses Trade dropdown on Escape
  ✗ dismisses Trade dropdown on outside click

New nav shape: Trade / Earn / Create a Market are plain links, Portfolio moved to the right beside the wallet, and Community is the only remaining NavDropdown (it absorbed Developers + Faucet from the old Build group).

Tests now match, keeping every behaviour that still exists:

test covers
renders the flat top-level links (new) Trade/Earn/Create/Portfolio as links with correct hrefs — the coverage the old dropdown tests used to provide
renders Community as the only dropdown trigger also asserts Build is not a button any more, so silently reverting to dropdowns would fail
open / Escape / outside-click now exercise Community — same NavDropdown component, just the group that survived

Mutation-verified, not merely passing:

mutation result
neutralise NavDropdown's Escape branch + mousedown listener both dismissal tests FAIL
rename the Portfolio link flat-links test FAILS
both restored pass

Full suite with the other open repair PRs stacked: 2806 passed, 0 failed.

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