test(core): integration + e2e coverage for edge group hidden-host guard (#1495)#1502
Open
mathuo wants to merge 1 commit into
Open
test(core): integration + e2e coverage for edge group hidden-host guard (#1495)#1502mathuo wants to merge 1 commit into
mathuo wants to merge 1 commit into
Conversation
… 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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 indockviewShell.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 realDockviewComponentwith an expanded right edge group, primes the shell'sResizeObserverat a real size, then fires it at0×0with the shell hidden (offsetParentnull). 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 viadisplay:nonemakes the nested shell'soffsetParentnull and fires a real0×0ResizeObserver; the edge group must keep its size. This is the only layer that reproduces the reported clamp: jsdom models neitherResizeObservernoroffsetParent, and a real browser does not fire a resize for a fully-removed element (so a plain tab-switch doesn't reproduce it —display:noneis 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
Affected packages
dockview-coreHow to test
yarn test(dockview-core): 1270 tests pass, including the new integration test.yarn test:e2e(Playwright): the newnested-edge-groupspec 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 lintclean on the changed sourceyarn testpasses🤖 Generated with Claude Code
Generated by Claude Code