mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 23:35:43 +00:00
test(editor): expand auto clip guard coverage
This commit is contained in:
@@ -25,7 +25,7 @@ describe("extendAutoFullTrackClip", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change multi-clip timelines or non-growing durations", () => {
|
||||
it("does not change multi-clip timelines", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[
|
||||
@@ -37,6 +37,9 @@ describe("extendAutoFullTrackClip", () => {
|
||||
10_000,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change clips when the duration does not grow", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[{ id: "clip-1", startMs: 0, endMs: 8_000, speed: 1 }],
|
||||
@@ -46,4 +49,59 @@ describe("extendAutoFullTrackClip", () => {
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change clips when the auto-created clip id is missing", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[{ id: "clip-1", startMs: 0, endMs: 5_000, speed: 1 }],
|
||||
null,
|
||||
5_000,
|
||||
8_000,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change clips when the previous auto-created end time is missing", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[{ id: "clip-1", startMs: 0, endMs: 5_000, speed: 1 }],
|
||||
"clip-1",
|
||||
null,
|
||||
8_000,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change clips when the reported duration shrinks", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[{ id: "clip-1", startMs: 0, endMs: 8_000, speed: 1 }],
|
||||
"clip-1",
|
||||
8_000,
|
||||
7_000,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change clips when the tracked clip id no longer matches", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[{ id: "clip-1", startMs: 0, endMs: 5_000, speed: 1 }],
|
||||
"clip-2",
|
||||
5_000,
|
||||
8_000,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("does not change clips when the clip no longer starts at zero", () => {
|
||||
expect(
|
||||
extendAutoFullTrackClip(
|
||||
[{ id: "clip-1", startMs: 250, endMs: 5_000, speed: 1 }],
|
||||
"clip-1",
|
||||
5_000,
|
||||
8_000,
|
||||
),
|
||||
).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user