mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: QA sweep fixes across migration, security, lint, and e2e tests
- fix(db): migration 0012 column order mismatch causing NOT NULL constraint failure on existing databases; use explicit column mapping instead of SELECT * - fix(db): disable FK checks during migrations to allow SQLite table-recreation pattern (DROP + RENAME) - fix(security): filter cookie_secret and instance_id from settings API response for non-admin users - fix(lint): resolve all 7 API lint warnings (noParameterAssign, noImplicitAnyLet) in compose, image-enhancement, and workspace - fix(docs): correct permission count from 16 to 14 in CLAUDE.md - fix(e2e): resolve 44 Playwright test failures across 8 spec files including locator specificity, compress mode defaults, format count, restore-photo UI drift, stitch image count, GIF animated fixtures, submit button timing, and processing timeouts
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import path from "node:path";
|
||||
import { expect, test, uploadTestImage, waitForProcessing } from "./helpers";
|
||||
|
||||
const FIXTURE_PNG = path.join(process.cwd(), "tests", "fixtures", "test-200x150.png");
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// GUI E2E: Utility Tools
|
||||
// (compare, find-duplicates, image-to-base64, barcode-read, qr-generate, bulk-rename)
|
||||
@@ -118,11 +121,11 @@ test.describe("GUI Utility Tools", () => {
|
||||
await page.goto("/image-to-base64");
|
||||
await uploadTestImage(page);
|
||||
|
||||
await expect(page.getByRole("button", { name: "Keep Original" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "JPEG" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "PNG" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "WebP" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "AVIF" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Keep Original", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "JPEG", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "PNG", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "WebP", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "AVIF", exact: true })).toBeVisible();
|
||||
});
|
||||
|
||||
test("quality slider appears for lossy formats", async ({ loggedInPage: page }) => {
|
||||
@@ -133,7 +136,7 @@ test.describe("GUI Utility Tools", () => {
|
||||
await expect(page.locator("#b64-quality")).not.toBeVisible();
|
||||
|
||||
// Switch to JPEG -- quality slider should appear
|
||||
await page.getByRole("button", { name: "JPEG" }).click();
|
||||
await page.getByRole("button", { name: "JPEG", exact: true }).click();
|
||||
await expect(page.locator("#b64-quality")).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -157,7 +160,7 @@ test.describe("GUI Utility Tools", () => {
|
||||
await page.goto("/image-to-base64");
|
||||
await uploadTestImage(page);
|
||||
|
||||
await page.getByRole("button", { name: "PNG" }).click();
|
||||
await page.getByRole("button", { name: "PNG", exact: true }).click();
|
||||
await expect(page.locator("#b64-quality")).not.toBeVisible();
|
||||
});
|
||||
|
||||
@@ -165,7 +168,7 @@ test.describe("GUI Utility Tools", () => {
|
||||
await page.goto("/image-to-base64");
|
||||
await uploadTestImage(page);
|
||||
|
||||
await page.getByRole("button", { name: "AVIF" }).click();
|
||||
await page.getByRole("button", { name: "AVIF", exact: true }).click();
|
||||
await expect(page.locator("#b64-quality")).toBeVisible();
|
||||
});
|
||||
});
|
||||
@@ -182,7 +185,12 @@ test.describe("GUI Utility Tools", () => {
|
||||
|
||||
test("shows scan button after upload", async ({ loggedInPage: page }) => {
|
||||
await page.goto("/barcode-read");
|
||||
await uploadTestImage(page);
|
||||
|
||||
const fileChooserPromise = page.waitForEvent("filechooser");
|
||||
await page.locator("[class*='border-dashed']").first().click();
|
||||
const fileChooser = await fileChooserPromise;
|
||||
await fileChooser.setFiles(FIXTURE_PNG);
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await expect(page.getByTestId("barcode-read-submit")).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user