From 901e6d02dbf86c1bd440efdd58723382496161d0 Mon Sep 17 00:00:00 2001 From: Miguel Angel Simon Sierra Date: Thu, 1 Oct 2026 22:40:50 -0700 Subject: [PATCH] test(studio): a drag on a mixed tween is one write under the gesture key --- .../hooks/gsapRuntimeBridge.sharedTween.test.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/studio/src/hooks/gsapRuntimeBridge.sharedTween.test.ts b/packages/studio/src/hooks/gsapRuntimeBridge.sharedTween.test.ts index 3d9fe60e73..8733503544 100644 --- a/packages/studio/src/hooks/gsapRuntimeBridge.sharedTween.test.ts +++ b/packages/studio/src/hooks/gsapRuntimeBridge.sharedTween.test.ts @@ -121,7 +121,7 @@ describe("tryGsapDragIntercept: which tweens a word's drag may use", () => { }); describe("tryGsapDragIntercept: one drag is one undo step", () => { - it("records the split and the move under one gesture key", async () => { + it("records the move under one gesture key, without splitting the mixed tween", async () => { document.body.innerHTML = `
`; const hero = document.getElementById("hero")!; const mixed = { @@ -133,12 +133,8 @@ describe("tryGsapDragIntercept: one drag is one undo step", () => { position: 0, resolvedStart: 0, duration: 1, + ease: "none", } as unknown as GsapAnimation; - const split = [ - { ...mixed, id: "#hero-fromTo-0-position", propertyGroup: "position" }, - { ...mixed, id: "#hero-fromTo-0-opacity", propertyGroup: "opacity" }, - ] as GsapAnimation[]; - let fetches = 0; const commitMutation = vi.fn(); await tryGsapDragIntercept( { id: "hero", selector: "#hero", element: hero } as unknown as DomEditSelection, @@ -146,10 +142,12 @@ describe("tryGsapDragIntercept: one drag is one undo step", () => { [mixed], null, commitMutation, - async () => (fetches++ === 0 ? [mixed] : split), + async () => [mixed], ); + const types = commitMutation.mock.calls.map((call) => call[1].type); const options = commitMutation.mock.calls.map((call) => call[2]); - expect(options.length).toBeGreaterThan(1); + expect(types).not.toContain("split-into-property-groups"); + expect(options.length).toBeGreaterThan(0); expect(new Set(options.map((o) => o.coalesceKey)).size).toBe(1); expect(options[0].coalesceKey).toMatch(/^gsap:drag:/); expect(options.every((o) => o.coalesceMs === Number.POSITIVE_INFINITY)).toBe(true);