Migrate project to TypeScript and Playwright scraping

This commit is contained in:
2026-08-05 13:47:45 +02:00
parent 8ecbc6655f
commit 639d9bec75
30 changed files with 3222 additions and 1625 deletions
+30
View File
@@ -0,0 +1,30 @@
// @ts-nocheck
import { test, expect } from "playwright/test";
test.describe("database connection", () => {
test("tests the configured Local DB connection", async ({ page }) => {
await page.goto("/");
await page.locator("#settingsButton").click();
await expect(page.locator('input[name="databaseMode"][value="local"]')).toBeChecked();
await page.locator("#localDbHost").fill("127.0.0.1");
await page.locator("#localDbPort").fill("3306");
await page.locator("#localDbName").fill("9bplus");
await page.locator("#localDbUser").fill("root");
await page.locator("#localDbPassword").fill("root");
await page.locator("#testLocalDbButton").click();
await expect(page.locator("#localDbTestResult")).toContainText("Connected:");
});
test("loads manufacturers from Local DB without Live endpoint fallback", async ({ page }) => {
const manufacturersResponse = page.waitForResponse("**/api/manufacturers");
await page.goto("/");
const response = await manufacturersResponse;
expect(response.ok()).toBeTruthy();
const data = await response.json();
expect(data.items.length).toBeGreaterThan(0);
expect(data.items.some((item) => item.name === "La Sportiva")).toBeTruthy();
});
});