fix: update tests for double-pause seek and formatted insertion

This commit is contained in:
Miguel Ángel
2026-05-21 22:00:14 -04:00
parent 2483ab5446
commit 0cc012cc06
3 changed files with 24 additions and 6 deletions
@@ -367,7 +367,16 @@ function BlockCard({
const prompt = buildAgentPrompt(title, name, description, category, blockType, context); const prompt = buildAgentPrompt(title, name, description, category, blockType, context);
onShowPrompt?.({ title, prompt }); onShowPrompt?.({ title, prompt });
}, },
[title, name, description, category, blockType, activeCompPath, compositionDimensions, onShowPrompt], [
title,
name,
description,
category,
blockType,
activeCompPath,
compositionDimensions,
onShowPrompt,
],
); );
return ( return (
@@ -524,7 +533,15 @@ function PromptPreviewModal({
className="p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50" className="p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50"
onClick={onClose} onClick={onClose}
> >
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round"> <svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
>
<line x1="18" y1="6" x2="6" y2="18" /> <line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" /> <line x1="6" y1="6" x2="18" y2="18" />
</svg> </svg>
@@ -18,13 +18,13 @@ describe("wrapTimeline seek keepPlaying option (#834)", () => {
}; };
} }
it("default seek pauses the GSAP timeline before seeking", () => { it("default seek pauses the GSAP timeline before and after seeking", () => {
const tl = mockTimeline(); const tl = mockTimeline();
const adapter = wrapTimeline(tl); const adapter = wrapTimeline(tl);
adapter.seek(5); adapter.seek(5);
expect(tl.pause).toHaveBeenCalledTimes(1); expect(tl.pause).toHaveBeenCalledTimes(2);
expect(tl.seek).toHaveBeenCalledWith(5); expect(tl.seek).toHaveBeenCalledWith(5);
}); });
@@ -44,7 +44,7 @@ describe("wrapTimeline seek keepPlaying option (#834)", () => {
adapter.seek(5, { keepPlaying: false }); adapter.seek(5, { keepPlaying: false });
expect(tl.pause).toHaveBeenCalledTimes(1); expect(tl.pause).toHaveBeenCalledTimes(2);
expect(tl.seek).toHaveBeenCalledWith(5); expect(tl.seek).toHaveBeenCalledWith(5);
}); });
}); });
@@ -155,6 +155,7 @@ describe("insertTimelineAssetIntoSource", () => {
'<img id="photo_asset" data-start="0" data-duration="3" />', '<img id="photo_asset" data-start="0" data-duration="3" />',
); );
expect(html).toContain('<div id="root" data-composition-id="main"><img id="photo_asset"'); expect(html).toContain('data-composition-id="main">');
expect(html).toContain('<img id="photo_asset"');
}); });
}); });