test(header): repoint nav tests at the consolidated Trade group (3 failures on playground) - #2459
test(header): repoint nav tests at the consolidated Trade group (3 failures on playground)#2459dcccrypto wants to merge 3 commits into
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
…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.
Updated — the nav changed again under this PR
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 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 Tests now match, keeping every behaviour that still exists:
Mutation-verified, not merely passing:
Full suite with the other open repair PRs stacked: 2806 passed, 0 failed. |
What broke
Header.test.tsxfails 3/3 onplayground(5550a19d):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/portfolioand/earnhubs. 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.testbut notHeader.test, which still probes for aWalletmenuitem.Fix — two different situations, not one blanket rename
shows Wallet link inside Trade dropdown/portfolio, preserving the intent: an open dropdown exposes its links asmenuitems with correcthrefsdismisses … on Escapedismisses … on outside clickVerification — the dismissal tests still bind
Swapping a probe can quietly make a test vacuous, so I mutation-tested it:
NavDropdown'sif (e.key === 'Escape') setOpen(false)and itsmousedownlistener neutralisedFull 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 Gatereport SKIPPED while the Merge Gate reports SUCCESS.🤖 Generated with Claude Code