Skip to content

Commit d90871a

Browse files
committed
Fixing test
1 parent 47081dd commit d90871a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/framer-motion/cypress/integration/scroll.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,13 @@ describe("scroll() full height target", () => {
309309
describe("scroll() container tracking", () => {
310310
it("correctly tracks position of a target with container of fixed height", () => {
311311
cy.visit("?test=scroll-explicit-height")
312-
.wait(100)
313-
.get("#scroll-container")
314-
.viewport(800, 500)
315-
.scrollTo(0, 1000)
312+
.viewport(800, 800)
316313
.wait(100)
317314
.get("#item-0")
318315
.should(([$element]: any) => {
319316
expect($element.style.opacity).to.equal("0")
320317
})
318+
.get("#scroll-container")
321319
.scrollTo(0, 1000)
322320
.wait(100)
323321
.get("#item-2")

packages/framer-motion/src/value/use-scroll.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ export function useScroll({
7777
if (needsStart.current) {
7878
invariant(
7979
!isRefPending(container),
80-
"Container ref is defined but not hydrated"
80+
"Container ref is defined but not hydrated",
81+
"use-scroll-ref"
8182
)
8283
invariant(
8384
!isRefPending(target),
84-
"Target ref is defined but not hydrated"
85+
"Target ref is defined but not hydrated",
86+
"use-scroll-ref"
8587
)
8688
return start()
8789
} else {

0 commit comments

Comments
 (0)