Skip to content

Commit 998ab1e

Browse files
committed
Coderabbit
1 parent 407f458 commit 998ab1e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

e2e/motion/exit-animation.spec.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ test.describe('AnimatePresence exit animation', () => {
4040
// Must be fully scaled in (scale = 1)
4141
if (transform === 'none') return true
4242

43+
// scale(s)
4344
const scaleMatch = transform.match(/scale\(([^)]+)\)/)
4445
if (scaleMatch) {
4546
const scale = parseFloat(scaleMatch[1])
4647
return scale >= 0.99
4748
}
4849

50+
// 2D matrix(a, b, c, d, tx, ty) → scaleX = a
4951
const matrixMatch = transform.match(/matrix\(([^)]+)\)/)
5052
if (matrixMatch) {
5153
const values = matrixMatch[1].split(',').map((v) => parseFloat(v.trim()))
@@ -55,7 +57,19 @@ test.describe('AnimatePresence exit animation', () => {
5557
}
5658
}
5759

58-
return true
60+
// 3D matrix3d(m11, m12, ..., m33, tx, ty, tz) → scaleX=m11 (index 0), scaleY=m22 (index 5)
61+
const matrix3dMatch = transform.match(/matrix3d\(([^)]+)\)/)
62+
if (matrix3dMatch) {
63+
const values = matrix3dMatch[1].split(',').map((v) => parseFloat(v.trim()))
64+
if (values.length >= 16) {
65+
const scaleX = values[0]
66+
const scaleY = values[5]
67+
return scaleX >= 0.99 && scaleY >= 0.99
68+
}
69+
}
70+
71+
// Unknown transform → fail closed
72+
return false
5973
},
6074
{ timeout: 5000 }
6175
)

0 commit comments

Comments
 (0)