fix: QA sweep — 7 bugs fixed, 17 test corrections

Code fixes:
- Sidebar state bleed: reset file store on HomePage mount
- restore-photo: raise error instead of silently skipping colorize
  when DDColor model missing
- PaddleOCR OOM: cap input images to 2048px before OCR inference
- Torch CPU optimization: use --index-url .../whl/cpu on CPU nodes

Test fixes:
- upscale: add exact:true to scale factor button locators
- smart-crop: add exact:true to "Pad to square" locator
- colorize: use regex for model button names (Best/Balanced/Fast)
- enhance-faces: use .first() for ambiguous percentage display
- passport-photo: fix DPI locator, .or() compound, generate fallback
- people: update maxUsers assertions for unlimited (0) default
- automate: "Save Pipeline" → "Save" matching actual button text
- tools.test: add resize to Sharp mock chain for OCR tests
This commit is contained in:
SnapOtter
2026-04-25 07:23:58 +08:00
parent bd84728588
commit bf0307d87d
12 changed files with 47 additions and 50 deletions
+5 -5
View File
@@ -33,9 +33,9 @@ test.describe("Upscale tool", () => {
await skipIfFeatureNotInstalled(page);
// Scale factor buttons
await expect(page.getByRole("button", { name: "2x" })).toBeVisible();
await expect(page.getByRole("button", { name: "4x" })).toBeVisible();
await expect(page.getByRole("button", { name: "8x" })).toBeVisible();
await expect(page.getByRole("button", { name: "2x", exact: true })).toBeVisible();
await expect(page.getByRole("button", { name: "4x", exact: true })).toBeVisible();
await expect(page.getByRole("button", { name: "8x", exact: true })).toBeVisible();
// Quality tier buttons
await expect(page.getByRole("button", { name: "Fast" })).toBeVisible();
@@ -63,11 +63,11 @@ test.describe("Upscale tool", () => {
test("scale factor buttons are interactive", async ({ loggedInPage: page }) => {
await skipIfFeatureNotInstalled(page);
const btn4x = page.getByRole("button", { name: "4x" });
const btn4x = page.getByRole("button", { name: "4x", exact: true });
await btn4x.click();
await expect(btn4x).toHaveClass(/bg-primary/);
const btn8x = page.getByRole("button", { name: "8x" });
const btn8x = page.getByRole("button", { name: "8x", exact: true });
await btn8x.click();
await expect(btn8x).toHaveClass(/bg-primary/);
});