Skip to content

Write HTML. Render video. Built for agents.

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

Miguel Ángel0cc012cc0671
diff --git a/packages/studio/src/components/sidebar/BlocksTab.tsx b/packages/studio/src/components/sidebar/BlocksTab.tsx
index b3938479a7..755e469607 100644
--- a/packages/studio/src/components/sidebar/BlocksTab.tsx
+++ b/packages/studio/src/components/sidebar/BlocksTab.tsx
@@ -367,7 +367,16 @@ function BlockCard({
const prompt = buildAgentPrompt(title, name, description, category, blockType, context);
onShowPrompt?.({ title, prompt });
},
- [title, name, description, category, blockType, activeCompPath, compositionDimensions, onShowPrompt],
+ [
+ title,
+ name,
+ description,
+ category,
+ blockType,
+ activeCompPath,
+ compositionDimensions,
+ onShowPrompt,
+ ],
);
return (
@@ -524,7 +533,15 @@ function PromptPreviewModal({
className="p-1 rounded-md text-neutral-500 hover:text-neutral-300 hover:bg-neutral-800/50"
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="6" y1="6" x2="18" y2="18" />
</svg>
diff --git a/packages/studio/src/player/lib/playbackAdapter.test.ts b/packages/studio/src/player/lib/playbackAdapter.test.ts
index ae96f88b3b..eadcdc54f1 100644
--- a/packages/studio/src/player/lib/playbackAdapter.test.ts
+++ b/packages/studio/src/player/lib/playbackAdapter.test.ts
@@ -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 adapter = wrapTimeline(tl);
adapter.seek(5);
- expect(tl.pause).toHaveBeenCalledTimes(1);
+ expect(tl.pause).toHaveBeenCalledTimes(2);
expect(tl.seek).toHaveBeenCalledWith(5);
});
@@ -44,7 +44,7 @@ describe("wrapTimeline seek keepPlaying option (#834)", () => {
adapter.seek(5, { keepPlaying: false });
- expect(tl.pause).toHaveBeenCalledTimes(1);
+ expect(tl.pause).toHaveBeenCalledTimes(2);
expect(tl.seek).toHaveBeenCalledWith(5);
});
});
diff --git a/packages/studio/src/utils/timelineAssetDrop.test.ts b/packages/studio/src/utils/timelineAssetDrop.test.ts
index 80ff8dcf35..9e59090396 100644
--- a/packages/studio/src/utils/timelineAssetDrop.test.ts
+++ b/packages/studio/src/utils/timelineAssetDrop.test.ts
@@ -155,6 +155,7 @@ describe("insertTimelineAssetIntoSource", () => {
'<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"');
});
});