Skip to content

test(e2e): cover unified DashboardContainer (collapse, border, tabs, drag)#2205

Open
alex-fedotyev wants to merge 1 commit intomainfrom
alex/e2e-dashboard-container
Open

test(e2e): cover unified DashboardContainer (collapse, border, tabs, drag)#2205
alex-fedotyev wants to merge 1 commit intomainfrom
alex/e2e-dashboard-container

Conversation

@alex-fedotyev
Copy link
Copy Markdown
Contributor

Summary

Follow-up E2E coverage for PR #2015 (the unified DashboardContainer
that replaced the legacy section/group concept). Drew explicitly asked
for this in his top-level review on #2015 ("Can you confirm we have
followup issues/tickets covering... 2. New E2E tests covering the new
functionality"). Unit coverage landed in #2015 itself; this PR adds
the missing browser-level coverage.

The container UX has four moving pieces, all exercised here:
collapsible (chevron + URL state), bordered (overflow-menu toggle +
inline border style), tabs (tab bar appearance, tab switching, URL
state), and drag-to-reorder via @dnd-kit. Each test step cites the
source line that defines the behavior so a reviewer can double-check
the assertion matches the implementation.

Test cases

  1. Group renders with default collapsible chevron and bordered style;
    chevron toggles aria-expanded.
  2. Toggling Hide Border / Show Border via the overflow menu flips the
    inline border style and the menu label.
  3. Adding a tab brings the tab bar (1-tab groups don't render it),
    switching tabs updates ?activeTabs and aria-selected.
  4. ?collapsed and ?expanded URL params survive reload and restore
    per-viewer state.
  5. ?activeTabs URL param survives reload and restores the active
    tab.
  6. Save-and-reload round-trip preserves the containers list, the
    bordered=false state on group A, and the second tab on group B.
  7. Drag-to-reorder: drag-onto-self is a no-op (the DnD guard at
    DashboardDndContext.tsx:67-70); dragging A onto C in [A, B, C]
    yields [B, C, A] (arrayMove semantics) and the new order
    persists across navigation.

Side fixes pulled in

  • DashboardPage.ts page-object selector was still pointing at the
    stale add-new-section-menu-item testid; PR refactor: Unify section/group into single Group with collapsible/bordered options #2015 renamed it to
    add-new-group-menu-item. No existing spec exercised addSection,
    so this hadn't surfaced. Renamed the locator and the helper from
    addSection -> addGroup.
  • DashboardContainer.tsx adds data-testid="group-add-tab-\${id}"
    on the existing Add Tab menu item so the spec doesn't have to
    match Mantine menu text. One-line non-behavior change.

Tier

Predicted Tier 2 by the local classifier: 1 production file,
10 production lines (the testid addition), no API/router/model
touch, single-layer (packages/app/). Test files are excluded from
the tier calculation per the classifier rules.

Out of scope

  • Multi-user URL state isolation (covered by
    dashboardSections.test.tsx unit tests).
  • Alert-dot indicators (covered by DashboardContainer.test.tsx).
  • Legacy type: "section" migration (one-time data shape; covered
    by dashboardSections.test.tsx).
  • Tile drag-reorder (uses react-grid-layout, not the new
    @dnd-kit container DnD).

Test plan

  • yarn lint clean.
  • yarn tsc --noEmit clean.
  • npx playwright test --list tests/e2e/features/dashboard-container.spec.ts lists all 7 cases.
  • prose-lint clean against origin/main.
  • Local tier prediction: Tier 2.
  • CI: full E2E shard run on this branch.

Refs PR #2015.

…drag)

PR #2015 unified the legacy section/group concept into a single
DashboardContainer with collapsible / bordered / tabs / drag-to-reorder
plus URL-state persistence. Unit tests landed with #2015; this PR adds
the missing E2E coverage that Drew called out in his top-level review.

What this covers:

- Default collapsible chevron + bordered style on a new group.
- Toggling Hide Border / Show Border via the overflow menu.
- Adding a tab so the tab bar appears, switching tabs updates
  ?activeTabs and aria-selected.
- ?collapsed and ?expanded URL params survive reload.
- ?activeTabs URL param survives reload and restores the active tab.
- Save-and-reload round-trip preserves containers, bordered=false, and
  the second tab on group B.
- Drag-to-reorder: drag-onto-self is a no-op (DnD guard); dragging A
  onto C in [A, B, C] yields [B, C, A] (arrayMove semantics) and the
  new order persists across navigation.

Side fixes:

- DashboardPage.ts page-object selector updated from the stale
  add-new-section-menu-item to add-new-group-menu-item (renamed by PR
  #2015 in DBDashboardPage.tsx); helper renamed addSection -> addGroup.
- DashboardContainer.tsx adds data-testid="group-add-tab-\${id}" on
  the existing Add Tab menu item so the spec does not have to rely on
  Mantine menu text.

No API or schema change. Test-only plus one data-testid line.

Tracker: Nerve task 2026-05-04-hyperdxiohyperdx-e2e-tests-for-unifie

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

⚠️ No Changeset found

Latest commit: 46b023c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment May 6, 2026 2:37am

Request Review

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 1
  • Production lines changed: 10 (+ 467 in test files, excluded from tier calculation)
  • Branch: alex/e2e-dashboard-container
  • Author: alex-fedotyev

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

{"review": "\n## PR Review\n\n✅ No critical issues found.\n\nThis is a clean, well-scoped E2E follow-up to PR #2015. Source change is minimal (one data-testid addition + two trivial comment punctuation tweaks). Highlights:\n\n- Page-object rename addSectionaddGroup is complete; no stale add-new-section-menu-item references remain.\n- URL param parsing in DashboardPage.ts correctly matches the nuqs serialization used in DBDashboardPage.tsx:1468-1483 (comma-separated for collapsed/expanded, JSON-encoded for activeTabs).\n- DnD helper correctly accounts for the 8px MouseSensor activation threshold from DashboardDndContext.tsx, with the 12px nudge before traversal.\n- Tests assert via stable data-testids and URL state rather than Mantine internals, which keeps them robust.\n\nMinor (non-blocking) observations only — feel free to ignore:\n- expect(dashboardPage.getCollapsedParam()).not.toContain(id) after a polled assertion on the opposite param relies on nuqs flushing both keys in the same tick. In practice that's true here, but if this ever flakes, wrap the negative assertion in expect.poll too.\n- style.border reads will silently pass if the component ever migrates to a CSS class. The inline-comment already calls this out, so it's a known trade-off."}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

E2E Test Results

3 tests failed • 161 passed • 3 skipped • 1215s

Status Count
✅ Passed 161
❌ Failed 3
⚠️ Flaky 6
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

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

Labels

review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant