Skip to content

test: pin dropbox placement, events and bundle size before replacing the popover plugins (1/3) - #503

Draft
gnbm wants to merge 9 commits into
vs-major-2.0.xfrom
gm/replace-plugins-1-safety-net
Draft

gnbm wants to merge 9 commits into
vs-major-2.0.xfrom
gm/replace-plugins-1-safety-net

Conversation

@gnbm

@gnbm gnbm commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Issue number: none


Part 1 of 3 stacked PRs that replace popover-plugin and tooltip-plugin, targeting the major branch vs-major-2.0.x. This one only adds tests and build checks; the next two change the code against them. Replaces #499.

What is the current behavior?

Virtual Select bundles popover-plugin 1.0.13 to place and animate the dropbox, and documents tooltip-plugin 1.0.16 as the optional tooltip. Nothing pins the dropbox's placement, classes, computed styles or open/close events, so replacing either plugin could change them unnoticed.

What is the new behavior?

  • npm run test:build checks the exact dist/ file set, that dist/ is newer than src/, and that every shipped minified file has a gzip budget it measures exactly (scripts/build-checks/size-budgets.json).
  • cypress/e2e/dropbox-positioning-baseline.cy.ts: 136 placement scenarios (every position × viewport edges × dropboxWrapper self/body, a wider dropbox, RTL, scrolled page, scrolling ancestor, a custom positioned wrapper, popup layout). Each compares placement, side, pop-comp-* classes and computed styles against cypress/fixtures/dropbox-baseline.json, recorded on this code, within 1 px, and then the state the dropbox is left in after closing.
    • Six scenarios keep tooltip-plugin loaded. A page that loads it after the bundle (the docs site, the README's optional setup) has its dropbox placed by tooltip-plugin's older engine, so those are recorded on that engine, at a fractional anchor where the two differ.
  • cypress/e2e/dropbox-lifecycle.cy.ts pins today's open/close events for every way of closing, including the duplicate afterClose, and for keepAlwaysOpen and popup instances.
  • No product code changes.

Does this introduce a breaking change?

  • Yes
  • No

Other information

  • The fixture was recorded locally on Windows/Electron; re-recording reproduces it exactly. If it ever needs re-recording, do it on this branch only, never on the later code, or the fixture would describe the new engine instead of the old one. A recording in which any scenario fails leaves the fixture alone.
  • With tooltip-plugin left loaded in every scenario, all 125 of the other scenarios also pass within 1 px, so the fixture holds for both engines.
  • Locally: typecheck, lint, stylelint, unit tests and build checks pass; e2e 579/579 in 32 specs.

gnbm and others added 6 commits November 24, 2026 08:32
Co-Authored-By: Claude <noreply@anthropic.com>
The spec runs without test isolation, so the page-scrolled scenarios' 3000px body and window scroll leaked into every later scenario. afterEach now clears both. Re-recorded on the popover-plugin engine (3a7f57c) with the reset: only scroll-ancestor|self changed, translate y 36 -> 40, the value it measures on a clean page.
…nished

afterOpen can fire a frame before the slide ends, so the 'before' position was read up to a few pixels short and CI saw 57.8 instead of 60. Wait for computed opacity 1 first, as the positioning baseline does.
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

PR Test Results — ✅ all checks passed

Check Result Time
Typecheck ✅ 2s
ESLint ✅ 2s
Stylelint ✅ 1s
CI Scripts ✅ 1s
Build ✅ 3s
a11y-aria-label.cy.ts ✅ 10/10 6s
a11y-close-clears-highlight.cy.ts ✅ 7/7 5s
a11y-escape-close.cy.ts ✅ 6/6 1s
a11y-listbox-multiselectable.cy.ts ✅ 3/3 1s
a11y-live-region.cy.ts ✅ 18/18 5s
a11y-reduced-motion.cy.ts ✅ 3/3 1s
a11y-required-error.cy.ts ✅ 20/20 3s
a11y-search-arrow-navigation.cy.ts ✅ 13/13 6s
a11y-select-all.cy.ts ✅ 7/7 3s
a11y-server-search-announcements.cy.ts ✅ 6/6 4s
a11y-target-size.cy.ts ✅ 5/5 2s
build-stylesheet-integrity.cy.ts ✅ 4/4 1s
disabled-interactions.cy.ts ✅ 7/7 1s
dropbox-lifecycle.cy.ts ✅ 14/14 8s
dropbox-positioning-baseline.cy.ts ✅ 136/136 31s
examples.cy.ts ✅ 219/219 1m18s
observer-listener-lifecycle.cy.ts ✅ 7/7 1s
perf-resize-throttle.cy.ts ✅ 3/3 1s
perf-scroll-aria.cy.ts ✅ 6/6 3s
secure-option-values.cy.ts ✅ 2/2 1s
secure-text-warning.cy.ts ✅ 4/4 1s
security-ampersand-storage.cy.ts ✅ 16/16 3s
security-chrome-label-props.cy.ts ✅ 10/10 1s
security-classnames-xss.cy.ts ✅ 2/2 1s
security-customdata-xss.cy.ts ✅ 2/2 1s
security-global-defaults.cy.ts ✅ 11/11 1s
security-hidden-input-name.cy.ts ✅ 7/7 1s
security-proto-value.cy.ts ✅ 9/9 1s
security-quote-escaping.cy.ts ✅ 12/12 2s
single-select-new-option-height.cy.ts ✅ 2/2 2s
tag-tooltip-overflow.cy.ts ✅ 6/6 11s
timer-cleanup.cy.ts ✅ 2/2 1s

Tested commit: 31dbff4 · Run #89

gnbm added 3 commits November 24, 2026 22:14
The spec runs without test isolation and cy.visit only changes the hash, so the reduced-motion stub leaked into the class-timing test, which then ran with 0 ms durations instead of 300. Restore it in afterEach and assert the duration the class-timing test relies on.
- The dropboxWrapper 'self' transform test first requires a translate3d to have been written, so two empty strings no longer pass.

- Build checks: maxGzip may not exceed baselineGzip; a budgeted file missing from dist/ fails with the build hint; the header explains the zero-headroom budgets and how to raise one.

- The positioning baseline refuses RECORD_BASELINE unless the popover-plugin engine is loaded, so the fixture cannot be re-recorded on the replacement.
Positioning baseline (fixture re-recorded on the popover-plugin engine; the
126 existing entries are unchanged):
- An `<id>|after-close` snapshot for every scenario that opens, checked like
  the never-opened state (host classes, pop-comp-* container classes, styles).
- custom-wrapper scenarios: the dropbox rendered into an offset, positioned,
  scrollable box given as a `dropboxWrapper` selector.
- tooltip-plugin scenarios: the docs site and the README's optional setup load
  tooltip.min.js after the bundle, and popover-plugin then places the dropbox
  with tooltip-plugin's older PopperComponent. These leave it loaded, at a
  fractional anchor where the two engines differ. A page reload is forced
  whenever the open page does not match the scenario, because visiting the
  URL already open does not reload it.
- A scenario failure, in record mode too, leaves the fixture alone and writes
  the actual set to ci-results/ instead. The JSON now ends in a newline.

Lifecycle: characterize keepAlwaysOpen and popup instances, which open and
close without the positioner.

Probe: an inline transform that is not `translate3d(...)` throws instead of
reading as [0, 0].

Size check: a budgeted file must measure exactly its maxGzip, every shipped
minified file needs a budget, and dist/ older than src/ fails instead of
measuring the stale committed bundle.

This branch has not been deployed

No deployments
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