Skip to content

Commit

Permalink
Latest
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed May 6, 2024
1 parent ec707da commit b4760f6
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions packages/framer-motion/src/gestures/__tests__/hover.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from "../../../jest.setup"
import { motion } from "../../"
import { motionValue } from "../../value"
import { frame } from "../../frameloop"
import { nextFrame } from "./utils"

describe("hover", () => {
Expand All @@ -21,13 +20,10 @@ describe("hover", () => {
pointerEnter(container.firstChild as Element)
pointerLeave(container.firstChild as Element)

return new Promise<void>((resolve) => {
frame.postRender(() => {
expect(hoverIn).toBeCalledTimes(1)
expect(hoverOut).toBeCalledTimes(1)
resolve()
})
})
await nextFrame()

expect(hoverIn).toBeCalledTimes(1)
expect(hoverOut).toBeCalledTimes(1)
})

test("filters touch events", async () => {
Expand All @@ -41,13 +37,9 @@ describe("hover", () => {
pointerEnter(container.firstChild as Element, { pointerType: "touch" })
pointerLeave(container.firstChild as Element, { pointerType: "touch" })

return new Promise<void>((resolve) => {
frame.postRender(() => {
expect(hoverIn).toBeCalledTimes(0)
expect(hoverOut).toBeCalledTimes(0)
resolve()
})
})
await nextFrame()
expect(hoverIn).toBeCalledTimes(0)
expect(hoverOut).toBeCalledTimes(0)
})

test("whileHover applied", async () => {
Expand Down

0 comments on commit b4760f6

Please sign in to comment.