Skip to content

fix(test): open overlays immediately when in test mode#112196

Merged
JoshuaKGoldberg merged 4 commits intomasterfrom
JoshuaKGoldberg/fix/test-instant-hover-overlays
Apr 7, 2026
Merged

fix(test): open overlays immediately when in test mode#112196
JoshuaKGoldberg merged 4 commits intomasterfrom
JoshuaKGoldberg/fix/test-instant-hover-overlays

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Apr 3, 2026

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.

@JoshuaKGoldberg JoshuaKGoldberg added the Frontend: Rerun Flaky Tests Known flaky tests should be run many times, just to be safe. label Apr 3, 2026
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 3, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 3, 2026
@JoshuaKGoldberg JoshuaKGoldberg changed the title fix(test): Open hover overlays immediately in Jest fix(test): open overlays immediately in Jest Apr 3, 2026
@JoshuaKGoldberg JoshuaKGoldberg changed the title fix(test): open overlays immediately in Jest fix(test): open overlays immediately when in test mode Apr 3, 2026
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the JoshuaKGoldberg/fix/test-instant-hover-overlays branch from d4b9304 to 5c8257a Compare April 3, 2026 14:22
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the JoshuaKGoldberg/fix/test-instant-hover-overlays branch from 5c8257a to 6dc0b86 Compare April 3, 2026 14:28
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

🚨 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 #discuss-dev-infra channel.

@JoshuaKGoldberg JoshuaKGoldberg force-pushed the JoshuaKGoldberg/fix/test-instant-hover-overlays branch from c11772f to 91364a0 Compare April 3, 2026 14:34
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
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the JoshuaKGoldberg/fix/test-instant-hover-overlays branch from 91364a0 to e3c9572 Compare April 3, 2026 14:35
@JoshuaKGoldberg JoshuaKGoldberg removed the Scope: Backend Automatically applied to PRs that change backend components label Apr 3, 2026
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review April 3, 2026 18:40
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners April 3, 2026 18:40
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners April 3, 2026 18:40
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread static/app/components/hovercard.spec.tsx
Copy link
Copy Markdown
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great refactor, nice work!

@JoshuaKGoldberg JoshuaKGoldberg requested review from a team, TkDodo and scttcper April 3, 2026 18:49
scttcper added a commit that referenced this pull request Apr 6, 2026
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
@JoshuaKGoldberg JoshuaKGoldberg merged commit b456371 into master Apr 7, 2026
76 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the JoshuaKGoldberg/fix/test-instant-hover-overlays branch April 7, 2026 13:20
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend: Rerun Flaky Tests Known flaky tests should be run many times, just to be safe. Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants