mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: resolve 18 QA-discovered bugs across tools, previews, and the AI pipeline (#242)
Exhaustive QA sweep of all 157 tools. Fixes: CSP blob media, csv-excel ExcelJS interop, ocr-pdf segfault, chart-maker upload, non-PDF doc preview, RAW decode, merge-tool multi-file path, html-to-image chromium, ogv/wma/amr/ac3 preview fallbacks, meme/gif/stabilize codecs, nav+home a11y. Plus orphan-format and test-debt cleanup, the AI bundle build script, and a reusable Playwright QA harness under tests/qa/.
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { detectModalityFromMime, MODALITIES, MODALITY_POOL, TOOLS } from "@snapotter/shared";
|
||||
import {
|
||||
detectModalityFromMime,
|
||||
MODALITIES,
|
||||
MODALITY_POOL,
|
||||
PYTHON_SIDECAR_TOOLS,
|
||||
TOOLS,
|
||||
} from "@snapotter/shared";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("modality metadata", () => {
|
||||
@@ -37,15 +43,16 @@ describe("modality metadata", () => {
|
||||
const pdfToImage = TOOLS.find((t) => t.id === "pdf-to-image");
|
||||
expect(pdfToImage).toBeDefined();
|
||||
expect(pdfToImage!.modality).toBe("document");
|
||||
expect(pdfToImage!.category).toBe("documents");
|
||||
expect(pdfToImage!.category).toBe("pdf-organize");
|
||||
expect(pdfToImage!.acceptedInputs).toEqual([".pdf"]);
|
||||
});
|
||||
|
||||
it("AI tools are hinted long (except pure-CV ones)", () => {
|
||||
const ai = TOOLS.filter((t) => t.category === "ai");
|
||||
it("AI (sidecar) tools are hinted long (except pure-CV ones)", () => {
|
||||
const sidecar = new Set<string>(PYTHON_SIDECAR_TOOLS as readonly string[]);
|
||||
const ai = TOOLS.filter((t) => sidecar.has(t.id));
|
||||
expect(ai.length).toBeGreaterThan(0);
|
||||
// image-enhancement is categorized "ai" but its core path is pure
|
||||
// sharp/CV; only the optional deepEnhance invokes a model.
|
||||
// image-enhancement uses pure sharp/CV (only the optional deepEnhance hits a
|
||||
// model); it is not a sidecar tool, but keep the guard explicit.
|
||||
const pureCvAiTools = new Set(["image-enhancement"]);
|
||||
for (const t of ai) {
|
||||
if (pureCvAiTools.has(t.id)) {
|
||||
|
||||
Reference in New Issue
Block a user