1- // fallow-ignore-file code-duplication
21// @vitest -environment happy-dom
32import { act } from "react" ;
43import { createRoot } from "react-dom/client" ;
@@ -12,7 +11,6 @@ const patchRuntimeTweenInPlace = vi.fn<(...args: unknown[]) => boolean>();
1211const applySoftReload = vi . fn < ( ...args : unknown [ ] ) => string > ( ) ;
1312const trackStudioEvent = vi . fn ( ) ;
1413const readNestedFiles = vi . fn < ( ...args : unknown [ ] ) => unknown > ( ( ) => null ) ;
15- const noteScriptWritten = vi . fn ( ) ;
1614
1715vi . mock ( "./gsapRuntimePatch" , ( ) => ( {
1816 patchRuntimeTweenInPlace : ( ...args : unknown [ ] ) => patchRuntimeTweenInPlace ( ...args ) ,
@@ -22,7 +20,6 @@ vi.mock("../utils/gsapSoftReload", async (importOriginal) => ({
2220 applySoftReload : ( ...args : unknown [ ] ) => applySoftReload ( ...args ) ,
2321 extractGsapScriptText : ( ) => "" ,
2422 readNestedFiles : ( ...args : unknown [ ] ) => readNestedFiles ( ...args ) ,
25- noteScriptWritten : ( ...args : unknown [ ] ) => noteScriptWritten ( ...args ) ,
2623} ) ) ;
2724vi . mock ( "../utils/studioTelemetry" , ( ) => ( {
2825 trackStudioEvent : ( ...args : unknown [ ] ) => trackStudioEvent ( ...args ) ,
@@ -81,7 +78,6 @@ describe("applyPreviewSync", () => {
8178 beforeEach ( ( ) => {
8279 patchRuntimeTweenInPlace . mockReset ( ) ;
8380 applySoftReload . mockReset ( ) ;
84- noteScriptWritten . mockReset ( ) ;
8581 trackStudioEvent . mockReset ( ) ;
8682 } ) ;
8783
@@ -695,7 +691,6 @@ describe("runCommit — instantPatch wiring", () => {
695691 beforeEach ( ( ) => {
696692 patchRuntimeTweenInPlace . mockReset ( ) ;
697693 applySoftReload . mockReset ( ) ;
698- noteScriptWritten . mockReset ( ) ;
699694 trackStudioEvent . mockReset ( ) ;
700695 readNestedFiles . mockReset ( ) . mockReturnValue ( null ) ;
701696 } ) ;
@@ -748,19 +743,6 @@ describe("runCommit — instantPatch wiring", () => {
748743 expect ( trackStudioEvent . mock . calls . filter ( ( [ event ] ) => event === "keyframe" ) ) . toEqual ( [ ] ) ;
749744 } ) ;
750745
751- it ( "notes the script a commit wrote though it skips the reload, so the next one clears its sets" , async ( ) => {
752- const written = 'gsap.set("#a", { width: 300 });' ;
753- mockFetchResult ( { scriptText : written } ) ;
754- const deps = renderCommitHook ( ) ;
755- await deps . api . commitMutation (
756- selection ,
757- { type : "set" } ,
758- { label : "Resize" , skipReload : true } ,
759- ) ;
760- expect ( noteScriptWritten ) . toHaveBeenCalledWith ( FAKE_IFRAME , written ) ;
761- expect ( applySoftReload ) . not . toHaveBeenCalled ( ) ;
762- } ) ;
763-
764746 it ( "does not count a failed write that skipReload suppresses" , async ( ) => {
765747 vi . stubGlobal (
766748 "fetch" ,
0 commit comments