Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry authored and mergatron[bot] committed Sep 4, 2023
1 parent 1609dcb commit e6a41ee
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions dev/optimized-appear/resync.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
startOptimizedAppearAnimation,
optimizedAppearDataAttribute,
motionValue,
frame,
} = window.Motion
const { matchViewportBox } = window.Assert
const root = document.getElementById("root")
Expand Down Expand Up @@ -66,12 +67,17 @@
* On animation start, check the values we expect to see here
*/
onAnimationStart: () => {
// matchViewportBox(document.getElementById("box"), {
// top: 100,
// right: 250,
// left: 150,
// bottom: 200,
// })
frame.postRender(() => {
const box = document.getElementById("box")

if (!box) return

const { opacity } = window.getComputedStyle(box)

if (parseFloat(opacity) < 0.7) {
showError(box, "Resync failed")
}
})
},
[optimizedAppearDataAttribute]: "a",
})
Expand Down

0 comments on commit e6a41ee

Please sign in to comment.