Skip to content

test(e2e): fix dashboard E2E test isolation and mobile viewport handling#737

Merged
steilerDev merged 1 commit intobetafrom
fix/736-e2e-dashboard-state-isolation
Mar 11, 2026
Merged

test(e2e): fix dashboard E2E test isolation and mobile viewport handling#737
steilerDev merged 1 commit intobetafrom
fix/736-e2e-dashboard-state-isolation

Conversation

@steilerDev
Copy link
Owner

Summary

  • Issue 1 — Shard 4 (desktop): Test state isolation Add a top-level test.beforeEach that resets dashboard.hiddenCards to [] via PATCH /api/users/me/preferences before every test. The dismiss test at line 422 persists card state server-side and was contaminating all subsequent tests in the shard. Also add a GET preferences intercept inside interceptDashboardApis() so tests using mocked APIs always see all cards visible regardless of actual server state.
  • Issue 2 — Shard 15 (mobile viewport): Desktop-grid-specific assertions Add viewport.width < 768 skip guards to Scenarios 2, 3, 4, Keyboard Navigation (Mini Gantt), and the ARIA Mini Gantt container test. On mobile, timeline/mini-gantt cards live inside collapsed <details> sections and budget data-testid elements are not directly visible, so these assertions only apply to the desktop/tablet flat grid.

Failing tests fixed

Shard 4 (state leakage):

  • "Dismissed card stays hidden after page reload" — Quick Actions already hidden
  • "Customize button appears when a card is dismissed" — same
  • "Customize dropdown lists dismissed card and clicking re-enables it" — same
  • "Each visible card has a dismiss button that is keyboard accessible" — expected 10 buttons, Quick Actions hidden
  • "Dashboard cards render in dark mode" — Quick Actions card not found
  • "Each card is an article with aria-labelledby pointing to its title" — Quick Actions card not found
  • "Dismiss button has correct aria-label" — Quick Actions dismiss button not found

Shard 15 (mobile viewport):

  • "All 10 card headings are visible" — timeline/budget-detail cards in collapsed sections
  • Budget Summary tests — data-testid elements inside collapsed mobile layout
  • Scenario 4 timeline cards — inside collapsed Timeline section
  • Mini Gantt keyboard nav — Mini Gantt inside collapsed Timeline section on mobile
  • Mini Gantt ARIA test — same

Test plan

  • CI E2E smoke tests pass (all viewport projects)
  • Full sharded E2E suite passes (shard 4 desktop, shard 15 mobile)
  • No regressions in other dashboard test scenarios

Fixes #736

🤖 Generated with Claude Code

Issue 1 (shard 4 — state isolation): Add a top-level test.beforeEach hook
that resets dashboard.hiddenCards preference to [] via PATCH before every
test. This prevents dismiss tests from leaking hidden-card state into
subsequent tests. Also add a GET preferences intercept in
interceptDashboardApis() so any test using mocked APIs always sees all
cards as visible, regardless of actual server state.

Issue 2 (shard 15 — mobile viewport): Timeline cards (Upcoming Milestones,
Work Item Progress, Critical Path) and Mini Gantt live inside collapsed
<details> sections on mobile. Budget Summary data-testid assertions also
only apply to the desktop/tablet flat grid. Add viewport < 768 skip guards
to Scenarios 2, 3, 4, Keyboard Navigation (Mini Gantt), and the ARIA
Mini Gantt container test so these desktop-grid-specific assertions are
not run against the mobile viewport project.

Co-Authored-By: Claude e2e-test-engineer (Opus 4.6) <[email protected]>
@steilerDev steilerDev merged commit d862e0b into beta Mar 11, 2026
11 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.15.0-beta.17 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants