@@ -542,54 +542,4 @@ const tl = gsap.timeline();
542542 // The variable target was not flattened to a string-literal selector
543543 expect ( result . after ) . toContain ( "tl.to(kicker," ) ;
544544 } ) ;
545-
546- it ( "stamps data-position-mode='relative' on the script tag after any mutation" , async ( ) => {
547- const projectDir = createProjectDir ( ) ;
548- const html = `<!DOCTYPE html><html><body>
549- <div id="hero" data-start="0" data-duration="4"></div>
550- <script>
551- const tl = gsap.timeline();
552- tl.to("#hero", { x: 100, duration: 2 }, 0);
553- </script></body></html>` ;
554- writeHtml ( projectDir , "index.html" , html ) ;
555- const app = new Hono ( ) ;
556- registerFileRoutes ( app , createAdapter ( projectDir ) ) ;
557-
558- const anim = await getFirstAnimation ( app , "index.html" ) ;
559- const res = await app . request ( "http://localhost/projects/demo/gsap-mutations/index.html" , {
560- method : "POST" ,
561- headers : { "Content-Type" : "application/json" } ,
562- body : JSON . stringify ( { type : "update-meta" , animationId : anim . id , updates : { position : 1 } } ) ,
563- } ) ;
564- const result = ( await res . json ( ) ) as { ok : boolean ; after : string } ;
565-
566- expect ( res . status ) . toBe ( 200 ) ;
567- expect ( result . ok ) . toBe ( true ) ;
568- expect ( result . after ) . toContain ( 'data-position-mode="relative"' ) ;
569- } ) ;
570-
571- it ( "does not duplicate data-position-mode on subsequent mutations" , async ( ) => {
572- const projectDir = createProjectDir ( ) ;
573- const html = `<!DOCTYPE html><html><body>
574- <div id="hero" data-start="0" data-duration="4"></div>
575- <script data-position-mode="relative">
576- const tl = gsap.timeline();
577- tl.to("#hero", { x: 100, duration: 2 }, 0);
578- </script></body></html>` ;
579- writeHtml ( projectDir , "index.html" , html ) ;
580- const app = new Hono ( ) ;
581- registerFileRoutes ( app , createAdapter ( projectDir ) ) ;
582-
583- const anim = await getFirstAnimation ( app , "index.html" ) ;
584- const res = await app . request ( "http://localhost/projects/demo/gsap-mutations/index.html" , {
585- method : "POST" ,
586- headers : { "Content-Type" : "application/json" } ,
587- body : JSON . stringify ( { type : "update-meta" , animationId : anim . id , updates : { position : 1 } } ) ,
588- } ) ;
589- const result = ( await res . json ( ) ) as { ok : boolean ; after : string } ;
590-
591- expect ( res . status ) . toBe ( 200 ) ;
592- const matches = result . after . match ( / d a t a - p o s i t i o n - m o d e / g) ;
593- expect ( matches ) . toHaveLength ( 1 ) ;
594- } ) ;
595545} ) ;
0 commit comments