Fix zero start time breaking

This commit is contained in:
Ajay
2022-10-07 12:19:42 -04:00
parent dabc63af73
commit 61fc1d2ed3
2 changed files with 22 additions and 1 deletions

View File

@@ -254,4 +254,25 @@ describe("Import segments", () => {
category: "chapter" as Category
}]);
});
it ("00:00", () => {
const input = ` 00:00 Cap 1
00:10 Cap 2
00:12 Cap 3`;
const result = importTimes(input, 8000);
expect(result).toMatchObject([{
segment: [0, 10],
description: "Cap 1",
category: "chapter" as Category
}, {
segment: [10, 12],
description: "Cap 2",
category: "chapter" as Category
}, {
segment: [12, 8000],
description: "Cap 3",
category: "chapter" as Category
}]);
});
});