diff --git a/packages/core/src/runtime/adapters/gsap.steps.test.ts b/packages/core/src/runtime/adapters/gsap.steps.test.ts index 1eefbd3404..7a83e1d43e 100644 --- a/packages/core/src/runtime/adapters/gsap.steps.test.ts +++ b/packages/core/src/runtime/adapters/gsap.steps.test.ts @@ -63,13 +63,18 @@ describe("gsap adapter on a step", () => { describe("gsap adapter at a tween's start", () => { // An edit at 2 s turns the later tween into keyframes; its first keyframe must win over the from() end. - it.each([0, 1, 2.5, 3])("shows the tween that starts at the seek time, seeking from %s s", (from) => { - const box = document.body.appendChild(document.createElement("div")); - const timeline = gsap.timeline({ paused: true }); - timeline.from(box, { x: -60, duration: 2, ease: "none" }, 0); - timeline.to(box, { keyframes: { "0%": { x: 5 }, "100%": { x: 60 } }, duration: 1 }, 2); - timeline.totalTime(from, true); - createGsapAdapter({ getTimeline: () => timeline as unknown as RuntimeTimelineLike }).seek({ time: 2 }); - expect(gsap.getProperty(box, "x")).toBe(5); - }); + it.each([0, 1, 2.5, 3])( + "shows the tween that starts at the seek time, seeking from %s s", + (from) => { + const box = document.body.appendChild(document.createElement("div")); + const timeline = gsap.timeline({ paused: true }); + timeline.from(box, { x: -60, duration: 2, ease: "none" }, 0); + timeline.to(box, { keyframes: { "0%": { x: 5 }, "100%": { x: 60 } }, duration: 1 }, 2); + timeline.totalTime(from, true); + createGsapAdapter({ getTimeline: () => timeline as unknown as RuntimeTimelineLike }).seek({ + time: 2, + }); + expect(gsap.getProperty(box, "x")).toBe(5); + }, + ); }); diff --git a/packages/core/src/runtime/adapters/gsap.ts b/packages/core/src/runtime/adapters/gsap.ts index f024e471c6..ba8291c39c 100644 --- a/packages/core/src/runtime/adapters/gsap.ts +++ b/packages/core/src/runtime/adapters/gsap.ts @@ -8,7 +8,10 @@ type GsapAdapterDeps = { * Re-renders a timeline already at `t`, silently. A forced render at the same time walks the children * forward in authored order and re-renders each one, including a child that starts exactly at `t`. */ -export function rerenderGsapTimelineAt(timeline: Pick, t: number): void { +export function rerenderGsapTimelineAt( + timeline: Pick, + t: number, +): void { timeline.render?.(t, true, true); }