aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/exporter.test.ts32
-rw-r--r--test/selenium.test.ts4
2 files changed, 34 insertions, 2 deletions
diff --git a/test/exporter.test.ts b/test/exporter.test.ts
index a3af0c04..596af640 100644
--- a/test/exporter.test.ts
+++ b/test/exporter.test.ts
@@ -275,4 +275,36 @@ describe("Import segments", () => {
category: "chapter" as Category
}]);
});
+
+ it ("0:00 G¹ (Tangent Continuity)", () => {
+ const input = ` 0:00 G¹ (Tangent Continuity)
+ 0:01 G² (Tangent Continuity)`;
+
+ const result = importTimes(input, 8000);
+ expect(result).toMatchObject([{
+ segment: [0, 1],
+ description: "G¹ (Tangent Continuity)",
+ category: "chapter" as Category
+ }, {
+ segment: [1, 8000],
+ description: "G² (Tangent Continuity)",
+ category: "chapter" as Category
+ }]);
+ });
+
+ it ("((Some name) 1:20)", () => {
+ const input = ` ((Some name) 1:20)
+ ((Some other name) 1:25)`;
+
+ const result = importTimes(input, 8000);
+ expect(result).toMatchObject([{
+ segment: [80, 85],
+ description: "Some name",
+ category: "chapter" as Category
+ }, {
+ segment: [85, 8000],
+ description: "Some other name",
+ category: "chapter" as Category
+ }]);
+ });
}); \ No newline at end of file
diff --git a/test/selenium.test.ts b/test/selenium.test.ts
index 6a0db09a..eb31a2ff 100644
--- a/test/selenium.test.ts
+++ b/test/selenium.test.ts
@@ -41,7 +41,7 @@ test("Selenium Chrome test", async () => {
// Save file incase there is a layout change
const source = await driver.getPageSource();
- fs.mkdirSync("./test-results");
+ if (!fs.existsSync("./test-results")) fs.mkdirSync("./test-results");
fs.writeFileSync("./test-results/source.html", source);
throw e;
@@ -55,7 +55,7 @@ async function setup(): Promise<WebDriver> {
options.addArguments("--load-extension=" + Path.join(__dirname, "../dist/"));
options.addArguments("--mute-audio");
options.addArguments("--disable-features=PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies");
- options.addArguments("--headless=chrome");
+ options.addArguments("--headless=new");
options.addArguments("--window-size=1920,1080");
const driver = await new Builder().forBrowser("chrome").setChromeOptions(options).build();