mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -4,6 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
// Mock sharp before any imports that use it
|
||||
vi.mock("sharp", () => {
|
||||
const mockSharp = vi.fn(() => ({
|
||||
resize: vi.fn().mockReturnThis(),
|
||||
png: vi.fn().mockReturnThis(),
|
||||
jpeg: vi.fn().mockReturnThis(),
|
||||
toBuffer: vi.fn().mockResolvedValue(Buffer.from("mock-png-data")),
|
||||
|
||||
Reference in New Issue
Block a user