fix(test): open overlays immediately when in test mode#112196
fix(test): open overlays immediately when in test mode#112196JoshuaKGoldberg merged 4 commits intomasterfrom
Conversation
d4b9304 to
5c8257a
Compare
5c8257a to
6dc0b86
Compare
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
c11772f to
91364a0
Compare
useHoverOverlay opens overlays immediately when NODE_ENV is test so Tooltip, Hovercard, and GroupPreviewHovercard specs do not race OPEN_DELAY or production delay props. Production behavior is unchanged; explicit delay={0} still avoids setTimeout in production.
Drop redundant delay props from Tooltip/Hovercard specs and remove Hovercard tests that assumed deferred open.
Stabilize EventGroupingInfoSection specs by clearing FoldSection localStorage between runs and expanding the section before assertions so persisted collapse state cannot hide the View button (addresses ENG-7208 / overlap with #111926).
Refs ENG-7208 ENG-7211 ENG-7212
Made-with: Cursor
91364a0 to
e3c9572
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
natemoo-re
left a comment
There was a problem hiding this comment.
Great refactor, nice work!
Skip all framer-motion animations in tests via `MotionGlobalConfig.skipAnimations = true` so components render immediately without waiting for animation frames or transitions. Also bumps framer-motion from 12.23.12 to 12.38.0. Drawer test benchmarks (before → after): - globalDrawer/index.spec.tsx: 4.76s → 1.15s (~4x faster) - 5 other drawer test suites: 8.57s → 3.24s (~2.6x faster) Ref: #112196
Removes the pattern of passing `delay={0}` / `displayTimeout={0}` in
specs: for _opening_ hover overlays immediately. That's now done
automatically in `useHoverOverlay` when `NODE_ENV === "test"`. This way
we don't need to manually create & pipe zero-value delay props around
various components.
Note that _closing_ timing is unchanged. That way any triggers to portal
content / async events still have a grace period in tests.
A few seemingly-unrelated tests had to be updated to account for
overlays now suddenly being available. I think this is good, actually,
because they previously were relying on timed opening not having
happened yet. See 92f3779.
Fixes ENG-7208. Fixes ENG-7211. Fixes ENG-7212.
Supersedes #111926, #111928, #111929, and #112004.

Removes the pattern of passing
delay={0}/displayTimeout={0}in specs: for opening hover overlays immediately. That's now done automatically inuseHoverOverlaywhenNODE_ENV === "test". This way we don't need to manually create & pipe zero-value delay props around various components.Note that closing timing is unchanged. That way any triggers to portal content / async events still have a grace period in tests.
A few seemingly-unrelated tests had to be updated to account for overlays now suddenly being available. I think this is good, actually, because they previously were relying on timed opening not having happened yet. See 92f3779.
Fixes ENG-7208. Fixes ENG-7211. Fixes ENG-7212.
Supersedes #111926, #111928, #111929, and #112004.