Skip to content

fix(test): Upgrade framer motion, Disable animations in tests#112270

Merged
scttcper merged 5 commits intomasterfrom
scttcper/disable-framer-motion-animations
Apr 6, 2026
Merged

fix(test): Upgrade framer motion, Disable animations in tests#112270
scttcper merged 5 commits intomasterfrom
scttcper/disable-framer-motion-animations

Conversation

@scttcper
Copy link
Copy Markdown
Member

@scttcper scttcper commented Apr 6, 2026

Skip all framer-motion animations in tests via MotionGlobalConfig.skipAnimations = true docs 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)

Test suite Before After Speedup
globalDrawer/index.spec.tsx 3.01s 1.20s 2.5x
eventFeatureFlagSection.spec.tsx 2.66s 2.30s 1.2x
breadcrumbsDataSection.spec.tsx 1.95s 1.58s 1.2x

This also benefits every other test that renders framer-motion components (modals, tooltips, any AnimatePresence usage).

Inspired by: #112196

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
@scttcper scttcper requested a review from a team as a code owner April 6, 2026 17:55
@scttcper scttcper changed the title fix(test): Disable framer-motion animations in tests fix(test): Upgrade framer motion, Disable animations in tests Apr 6, 2026
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 6, 2026
@JonasBa
Copy link
Copy Markdown
Member

JonasBa commented Apr 6, 2026

@scttcper Does this mean we could get rid of the testableTransition?

I would like to get to a state where everyone uses theme.motion.framer animations so that we can centralize all this logic and also account for prefers reduced motion and disable animations entirely

@evanpurkhiser
Copy link
Copy Markdown
Member

Does this mean we could get rid of the testableTransition

was just putting together a codemod for this

@evanpurkhiser
Copy link
Copy Markdown
Member

also account for prefers reduced motion and disable animations entirely

I think we can do that now with a global reduce motion config also?

@scttcper scttcper merged commit 4c80d59 into master Apr 6, 2026
70 checks passed
@scttcper scttcper deleted the scttcper/disable-framer-motion-animations branch April 6, 2026 19:35
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
Skip all framer-motion animations in tests via
`MotionGlobalConfig.skipAnimations = true`
[docs](motiondivision/motion@3dffb40)
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)

| Test suite | Before | After | Speedup |
|---|---|---|---|
| `globalDrawer/index.spec.tsx` | 3.01s | 1.20s | 2.5x |
| `eventFeatureFlagSection.spec.tsx` | 2.66s | 2.30s | 1.2x |
| `breadcrumbsDataSection.spec.tsx` | 1.95s | 1.58s | 1.2x |

This also benefits every other test that renders framer-motion
components (modals, tooltips, any `AnimatePresence` usage).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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