Skip to content

Commit

Permalink
Makes view transition e2e tests compatible with Firefox (#11093)
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp authored May 21, 2024
1 parent bfe9c73 commit a514bbe
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ViewTransitions, fade } from 'astro:transitions';
<ViewTransitions />
</head>
<body>
<h1 transition:name="h1" transition:animate={fade({duration:10000})}>Abort</h1>
<h1 transition:name="h1" transition:animate={fade({duration:500})}>Abort</h1>
</body>
</html>

Expand All @@ -15,11 +15,10 @@ import { ViewTransitions, fade } from 'astro:transitions';
import {navigate } from 'astro:transitions/client';

setTimeout(()=>{
[...document.getAnimations()].forEach((a) => a.addEventListener('cancel',
(e) => console.log("[test]",e.type, a.animationName)));
console.log("[test] navigate to /one")
[...document.getAnimations()].forEach((a) => a.addEventListener('cancel', (e) => console.log("[test]", e.type, a.animationName)));
console.log("[test] navigate to /one");
navigate("/one");
}, 1000);
}, 200);
console.log('[test] navigate to "."')
navigate("/abort2");
</script>
Loading

0 comments on commit a514bbe

Please sign in to comment.