Persist scrape database write permissions

This commit is contained in:
2026-08-05 23:24:49 +02:00
parent 67753fb025
commit 19c6ee90e1
4 changed files with 24 additions and 8 deletions
+17 -1
View File
@@ -17,7 +17,7 @@ test.describe("database connection", () => {
await expect(page.locator("#localDbTestResult")).toContainText("Connected:");
});
test("keeps the scrape database as a separate read-only mode", async ({ page }) => {
test("keeps the scrape database as a separate local mode with its own permissions", async ({ page }) => {
await page.goto("/");
await page.locator("#settingsButton").click();
@@ -25,6 +25,22 @@ test.describe("database connection", () => {
await expect(page.locator('input[name="databaseMode"][value="live"] + span')).toHaveText("Live 9bplus DB");
await page.locator('input[name="databaseMode"][value="scrape"]').check();
await expect(page.locator("#databaseModeNote")).toContainText("Local scrape DB selected");
await expect(page.locator("#allowInsertToggle")).toBeEnabled();
await expect(page.locator("#allowUpdateToggle")).toBeEnabled();
await expect(page.locator("#allowDeleteToggle")).toBeEnabled();
await page.locator("#allowUpdateToggle").check();
await page.reload();
await page.locator("#settingsButton").click();
await page.locator('input[name="databaseMode"][value="scrape"]').check();
await expect(page.locator("#allowUpdateToggle")).toBeChecked();
await page.locator('input[name="databaseMode"][value="local"]').check();
await expect(page.locator("#allowInsertToggle")).not.toBeChecked();
await expect(page.locator("#allowUpdateToggle")).not.toBeChecked();
await expect(page.locator("#allowDeleteToggle")).not.toBeChecked();
await page.locator('input[name="databaseMode"][value="live"]').check();
await expect(page.locator("#allowInsertToggle")).toBeDisabled();
await expect(page.locator("#allowUpdateToggle")).toBeDisabled();
await expect(page.locator("#allowDeleteToggle")).toBeDisabled();