Skip to content

test(core): integration + e2e coverage for edge group hidden-host guard (#1495)#1502

Open
mathuo wants to merge 1 commit into
v8-branchfrom
claude/issue-1495-tests-v8
Open

test(core): integration + e2e coverage for edge group hidden-host guard (#1495)#1502
mathuo wants to merge 1 commit into
v8-branchfrom
claude/issue-1495-tests-v8

Conversation

@mathuo

@mathuo mathuo commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Description

Follow-up test coverage for the #1495 fix (the shell resize-observer visibility guard, already on v8-branch). The guard itself is unit-tested in dockviewShell.spec.ts; this adds two higher-level tests that exercise it closer to the real reported scenario.

1. edgeGroupHiddenHost.spec.ts (jsdom integration) — drives a real DockviewComponent with an expanded right edge group, primes the shell's ResizeObserver at a real size, then fires it at 0×0 with the shell hidden (offsetParent null). Asserts the serialized edge-group size is preserved, not clamped. Verified to fail without the guard (85 vs 300).

2. nested-edge-group.spec.ts (Playwright / real browser) — a dockview nested inside a host panel that has a right edge group. Hiding the host via display:none makes the nested shell's offsetParent null and fires a real 0×0 ResizeObserver; the edge group must keep its size. This is the only layer that reproduces the reported clamp: jsdom models neither ResizeObserver nor offsetParent, and a real browser does not fire a resize for a fully-removed element (so a plain tab-switch doesn't reproduce it — display:none is the faithful "host hidden" trigger). Verified to fail without the guard (clamps to 85 and does not recover on reshow). Adds a nested-dockview host component + helpers to the shared e2e fixture.

Type of change

  • Build / CI / tooling (tests only — no product code change)

Affected packages

  • dockview-core

How to test

  • yarn test (dockview-core): 1270 tests pass, including the new integration test.
  • yarn test:e2e (Playwright): the new nested-edge-group spec passes. Note: the e2e suite is not currently wired into CI, so it was run locally against freshly-built bundles (nx run-many -t build:bundle -p dockview-core dockview-enterprise dockview) with headless Chromium; both the pass (with guard) and the fail (guard removed) were confirmed.

Checklist

  • biome format / biome lint clean on the changed source
  • yarn test passes
  • Both tests were confirmed to fail without the fix (genuine regression coverage)

🤖 Generated with Claude Code


Generated by Claude Code

… guard (#1495)

Adds two higher-level tests for the shell resize-observer visibility guard
that preserves an edge group's size when its host is hidden (the unit-level
guard already lives in dockviewShell.spec.ts).

- edgeGroupHiddenHost.spec.ts (jsdom): drives a real DockviewComponent with an
  expanded right edge group, fires the shell ResizeObserver at 0x0 with the
  shell hidden (offsetParent null), and asserts the serialized size is
  preserved rather than clamped to the minimum. Fails without the guard
  (85 vs 300).

- nested-edge-group.spec.ts (Playwright): a dockview nested inside a host panel
  with a right edge group. Hiding the host via display:none fires a real 0x0
  ResizeObserver inside the nested dockview; the edge group must keep its size.
  Reproduces the reported clamp in a real browser — the only layer that can,
  since jsdom models neither ResizeObserver nor offsetParent, and a browser
  does not fire a resize for a fully-removed element. Fails without the guard
  (clamps to 85 and does not recover on reshow). Extends the e2e fixture with a
  nested-dockview host component and helpers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018axBKCULSaEET94Tefd1Ru
@sonarqubecloud

Copy link
Copy Markdown

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