Skip to content

Commit f785461

Browse files
committed
test(core): a split half with no id stops at its own end
1 parent 595fa1e commit f785461

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/core/src/runtime/init.subCompositionPlacement.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,19 @@ describe("runtime sub-composition placement", () => {
331331
expect(video("body").currentTime).toBe(4);
332332
});
333333

334+
it("cuts a split half that has no id at its own end, not its file's", () => {
335+
// Studio's split of a host without an id: the half is found by its composition attributes.
336+
mountInRoot(
337+
`<div class="clip" data-composition-file="compositions/scene.html" data-start="5" data-duration="4" ` +
338+
`data-playback-start="5"><div data-composition-id="scene" data-duration="12">` +
339+
`<video id="late" data-start="8" data-duration="4"></video></div></div>`,
340+
);
341+
window.__player?.renderSeek(8.5);
342+
expect(video("late").currentTime).toBe(0.5);
343+
window.__player?.renderSeek(10);
344+
expect(video("late").currentTime).toBe(0.5);
345+
});
346+
334347
it("keeps a video in a composition nested inside the half silent until the half starts", () => {
335348
loadSecondHalf(
336349
`<div data-composition-id="inner" data-composition-file="compositions/inner.html" data-start="0" data-duration="12">` +

0 commit comments

Comments
 (0)