mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test: reorganize fixture files into modality-first layout (phase 6b)
Move all fixture files from flat/mixed dirs (content/, media/, documents/,
formats/, hostile/, root loose) into the modality-first hierarchy:
image/{valid,formats,edge,hostile}, video/{valid,formats,hostile},
audio/{valid,formats,hostile}, document/{valid,formats,edge,hostile},
data/valid/, security/. Update index.ts paths, fixtureDir aliases,
all literal refs in 17 e2e/qa/script files, manifest.json, and the
three generator scripts. 163 files moved, 0 dropped, 100 new tests
from expanded document scan.
This commit is contained in:
Vendored
+118
-92
@@ -7,135 +7,161 @@ const p = (rel: string): string => join(ROOT, rel);
|
||||
|
||||
export const fixtureRoot = ROOT;
|
||||
export const fixtureDir = {
|
||||
formats: join(ROOT, "formats"),
|
||||
hostile: join(ROOT, "hostile"),
|
||||
media: join(ROOT, "media"),
|
||||
documents: join(ROOT, "documents"),
|
||||
data: join(ROOT, "data"),
|
||||
content: join(ROOT, "content"),
|
||||
// Backward-compat flat aliases (used by format-matrix, hostile-inputs, multimodal tests)
|
||||
formats: join(ROOT, "image/formats"),
|
||||
hostile: join(ROOT, "image/hostile"),
|
||||
media: join(ROOT, "video/formats"),
|
||||
documents: join(ROOT, "document/formats"),
|
||||
data: join(ROOT, "data/valid"),
|
||||
security: join(ROOT, "security"),
|
||||
// Modality-structured dirs
|
||||
image: {
|
||||
valid: join(ROOT, "image/valid"),
|
||||
formats: join(ROOT, "image/formats"),
|
||||
edge: join(ROOT, "image/edge"),
|
||||
hostile: join(ROOT, "image/hostile"),
|
||||
},
|
||||
video: {
|
||||
valid: join(ROOT, "video/valid"),
|
||||
formats: join(ROOT, "video/formats"),
|
||||
hostile: join(ROOT, "video/hostile"),
|
||||
},
|
||||
audio: {
|
||||
valid: join(ROOT, "audio/valid"),
|
||||
formats: join(ROOT, "audio/formats"),
|
||||
hostile: join(ROOT, "audio/hostile"),
|
||||
},
|
||||
document: {
|
||||
valid: join(ROOT, "document/valid"),
|
||||
formats: join(ROOT, "document/formats"),
|
||||
edge: join(ROOT, "document/edge"),
|
||||
hostile: join(ROOT, "document/hostile"),
|
||||
},
|
||||
};
|
||||
|
||||
export const fixtures = {
|
||||
image: {
|
||||
base: {
|
||||
png200: p("test-200x150.png"),
|
||||
jpg100: p("test-100x100.jpg"),
|
||||
webp50: p("test-50x50.webp"),
|
||||
svg100: p("test-100x100.svg"),
|
||||
heic200: p("test-200x150.heic"),
|
||||
png200: p("image/valid/test-200x150.png"),
|
||||
jpg100: p("image/valid/test-100x100.jpg"),
|
||||
webp50: p("image/valid/test-50x50.webp"),
|
||||
svg100: p("image/valid/test-100x100.svg"),
|
||||
heic200: p("image/valid/test-200x150.heic"),
|
||||
},
|
||||
scene: p("test-scene.png"),
|
||||
scene: p("image/valid/test-scene.png"),
|
||||
portrait: {
|
||||
jpg: p("content/portrait-color.jpg"),
|
||||
heic: p("content/portrait-headshot.heic"),
|
||||
bw: p("content/portrait-bw.jpeg"),
|
||||
isolated: p("content/portrait-isolated.png"),
|
||||
jpg: p("image/valid/portrait-color.jpg"),
|
||||
heic: p("image/valid/portrait-headshot.heic"),
|
||||
bw: p("image/valid/portrait-bw.jpeg"),
|
||||
isolated: p("image/valid/portrait-isolated.png"),
|
||||
},
|
||||
multiFace: p("content/multi-face.webp"),
|
||||
redEye: p("content/red-eye.jpg"),
|
||||
exifGps: p("test-with-exif.jpg"),
|
||||
transparent: p("test-fake-transparency.png"),
|
||||
multiFace: p("image/valid/multi-face.webp"),
|
||||
redEye: p("image/valid/red-eye.jpg"),
|
||||
exifGps: p("image/valid/test-with-exif.jpg"),
|
||||
transparent: p("image/edge/test-fake-transparency.png"),
|
||||
animated: {
|
||||
gif: p("animated.gif"),
|
||||
webp: p("animated.webp"),
|
||||
real: p("content/animated-simpsons.gif"),
|
||||
gif: p("image/valid/animated.gif"),
|
||||
webp: p("image/valid/animated.webp"),
|
||||
real: p("image/valid/animated-simpsons.gif"),
|
||||
},
|
||||
ocr: {
|
||||
clean: p("content/ocr-clean.png"),
|
||||
japanese: p("content/ocr-japanese.png"),
|
||||
chat: p("content/ocr-chat.jpeg"),
|
||||
clean: p("image/valid/ocr-clean.png"),
|
||||
japanese: p("image/valid/ocr-japanese.png"),
|
||||
chat: p("image/valid/ocr-chat.jpeg"),
|
||||
},
|
||||
code: {
|
||||
barcodePng: p("content/barcode.png"),
|
||||
barcodeAvif: p("content/barcode.avif"),
|
||||
qrPng: p("content/qr-code.png"),
|
||||
qrSvg: p("content/qr-code.svg"),
|
||||
qrAvif: p("content/qr-code.avif"),
|
||||
barcodePng: p("image/valid/barcode.png"),
|
||||
barcodeAvif: p("image/valid/barcode.avif"),
|
||||
qrPng: p("image/valid/qr-code.png"),
|
||||
qrSvg: p("image/valid/qr-code.svg"),
|
||||
qrAvif: p("image/valid/qr-code.avif"),
|
||||
},
|
||||
svgLogo: p("content/svg-logo.svg"),
|
||||
motorcycle: p("content/motorcycle.heif"),
|
||||
crossFormatChat: p("content/cross-format-chat.webp"),
|
||||
portraitJpg: p("test-portrait.jpg"),
|
||||
portraitHeic: p("test-portrait.heic"),
|
||||
watermark: p("content/watermark.jpg"),
|
||||
stressLarge: p("content/stress-large.jpg"),
|
||||
svgLogo: p("image/valid/svg-logo.svg"),
|
||||
motorcycle: p("image/valid/motorcycle.heif"),
|
||||
crossFormatChat: p("image/valid/cross-format-chat.webp"),
|
||||
portraitJpg: p("image/valid/test-portrait.jpg"),
|
||||
portraitHeic: p("image/valid/test-portrait.heic"),
|
||||
watermark: p("image/valid/watermark.jpg"),
|
||||
stressLarge: p("image/valid/stress-large.jpg"),
|
||||
edge: {
|
||||
px1: p("test-1x1.png"),
|
||||
blank: p("test-blank.png"),
|
||||
tall: p("test-portrait-tall.png"),
|
||||
extreme: p("test-portrait-extreme.png"),
|
||||
px1: p("image/edge/test-1x1.png"),
|
||||
blank: p("image/edge/test-blank.png"),
|
||||
tall: p("image/edge/test-portrait-tall.png"),
|
||||
extreme: p("image/edge/test-portrait-extreme.png"),
|
||||
},
|
||||
formats: (ext: string) => p(`formats/sample.${ext}`),
|
||||
multipageTiff: p("formats/multipage.tiff"),
|
||||
formats: (ext: string) => p(`image/formats/sample.${ext}`),
|
||||
multipageTiff: p("image/formats/multipage.tiff"),
|
||||
hostile: {
|
||||
truncated: p("hostile/truncated.jpg"),
|
||||
garbage: p("hostile/garbage.jpg"),
|
||||
bomb: p("hostile/bomb-50000x50000.png"),
|
||||
extMismatch: p("hostile/png-bytes.jpg"),
|
||||
truncated: p("image/hostile/truncated.jpg"),
|
||||
garbage: p("image/hostile/garbage.jpg"),
|
||||
bomb: p("image/hostile/bomb-50000x50000.png"),
|
||||
extMismatch: p("image/hostile/png-bytes.jpg"),
|
||||
},
|
||||
hostileEmpty: { zeroByte: p("hostile/zero-byte.png") },
|
||||
hostileEmpty: { zeroByte: p("image/hostile/zero-byte.png") },
|
||||
},
|
||||
video: {
|
||||
hero: {
|
||||
mp4: p("content/media-30s.mp4"),
|
||||
mov: p("content/hero.mov"),
|
||||
webm: p("content/hero.webm"),
|
||||
mkv: p("content/hero.mkv"),
|
||||
avi: p("content/hero.avi"),
|
||||
mp4: p("video/valid/media-30s.mp4"),
|
||||
mov: p("video/valid/hero.mov"),
|
||||
webm: p("video/valid/hero.webm"),
|
||||
mkv: p("video/valid/hero.mkv"),
|
||||
avi: p("video/valid/hero.avi"),
|
||||
},
|
||||
speech: { mp4: p("content/speech-10s.mp4") },
|
||||
withMeta: p("content/video-with-meta.mp4"),
|
||||
tiny: (ext: string) => p(`media/tiny.${ext}`),
|
||||
speech: { mp4: p("video/valid/speech-10s.mp4") },
|
||||
withMeta: p("video/valid/video-with-meta.mp4"),
|
||||
tiny: (ext: string) => p(`video/formats/tiny.${ext}`),
|
||||
subs: {
|
||||
mkv: p("media/tiny-subs.mkv"),
|
||||
srt: p("media/tiny.srt"),
|
||||
vtt: p("media/tiny.vtt"),
|
||||
ass: p("media/tiny.ass"),
|
||||
mkv: p("video/formats/tiny-subs.mkv"),
|
||||
srt: p("video/formats/tiny.srt"),
|
||||
vtt: p("video/formats/tiny.vtt"),
|
||||
ass: p("video/formats/tiny.ass"),
|
||||
},
|
||||
hostile: { truncated: p("hostile/truncated.mp4") },
|
||||
hostile: { truncated: p("video/hostile/truncated.mp4") },
|
||||
},
|
||||
audio: {
|
||||
speech: {
|
||||
wav: p("content/speech-10s.wav"),
|
||||
flac: p("content/speech.flac"),
|
||||
ogg: p("content/speech.ogg"),
|
||||
m4a: p("content/speech.m4a"),
|
||||
aac: p("content/speech.aac"),
|
||||
opus: p("content/speech.opus"),
|
||||
wav: p("audio/valid/speech-10s.wav"),
|
||||
flac: p("audio/valid/speech.flac"),
|
||||
ogg: p("audio/valid/speech.ogg"),
|
||||
m4a: p("audio/valid/speech.m4a"),
|
||||
aac: p("audio/valid/speech.aac"),
|
||||
opus: p("audio/valid/speech.opus"),
|
||||
},
|
||||
music: { wav: p("content/media-30s.wav") },
|
||||
tagged: p("content/audio-with-tags.mp3"),
|
||||
stereo: p("media/tone-stereo.wav"),
|
||||
gap: p("media/tone-gap.wav"),
|
||||
tiny: (ext: string) => p(`media/tiny.${ext}`),
|
||||
hostileEmpty: { zeroByte: p("hostile/zero-byte.wav") },
|
||||
music: { wav: p("audio/valid/media-30s.wav") },
|
||||
tagged: p("audio/valid/audio-with-tags.mp3"),
|
||||
stereo: p("audio/formats/tone-stereo.wav"),
|
||||
gap: p("audio/formats/tone-gap.wav"),
|
||||
tiny: (ext: string) => p(`audio/formats/tiny.${ext}`),
|
||||
hostileEmpty: { zeroByte: p("audio/hostile/zero-byte.wav") },
|
||||
},
|
||||
document: {
|
||||
pdfMulti: p("content/multipage-6.pdf"),
|
||||
pdf2: p("content/alt-2page.pdf"),
|
||||
pdf3: p("test-3page.pdf"),
|
||||
pdfScanned: p("content/ocr-scanned.pdf"),
|
||||
encrypted: p("documents/encrypted.pdf"),
|
||||
tiny: (ext: string) => p(`documents/tiny.${ext}`),
|
||||
remoteImgHtml: p("documents/remote-img.html"),
|
||||
hostile: { truncatedDocx: p("hostile/truncated.docx"), garbagePdf: p("hostile/garbage.pdf") },
|
||||
pdfMulti: p("document/valid/multipage-6.pdf"),
|
||||
pdf2: p("document/valid/alt-2page.pdf"),
|
||||
pdf3: p("document/valid/test-3page.pdf"),
|
||||
pdfScanned: p("document/valid/ocr-scanned.pdf"),
|
||||
encrypted: p("document/valid/encrypted.pdf"),
|
||||
tiny: (ext: string) => p(`document/formats/tiny.${ext}`),
|
||||
remoteImgHtml: p("document/edge/remote-img.html"),
|
||||
hostile: {
|
||||
truncatedDocx: p("document/hostile/truncated.docx"),
|
||||
garbagePdf: p("document/hostile/garbage.pdf"),
|
||||
},
|
||||
},
|
||||
data: {
|
||||
csv: p("data/tiny.csv"),
|
||||
csvA: p("data/tiny-a.csv"),
|
||||
csvB: p("data/tiny-b.csv"),
|
||||
json: p("data/tiny.json"),
|
||||
xml: p("data/tiny.xml"),
|
||||
yaml: p("data/tiny.yaml"),
|
||||
tsv: p("data/tiny.tsv"),
|
||||
zip: p("data/tiny.zip"),
|
||||
csv: p("data/valid/tiny.csv"),
|
||||
csvA: p("data/valid/tiny-a.csv"),
|
||||
csvB: p("data/valid/tiny-b.csv"),
|
||||
json: p("data/valid/tiny.json"),
|
||||
xml: p("data/valid/tiny.xml"),
|
||||
yaml: p("data/valid/tiny.yaml"),
|
||||
tsv: p("data/valid/tiny.tsv"),
|
||||
zip: p("data/valid/tiny.zip"),
|
||||
},
|
||||
security: {
|
||||
svgXxeFile: p("security/svg-xxe-file-read.svg"),
|
||||
svgXxeSsrf: p("security/svg-xxe-ssrf.svg"),
|
||||
polyglot: p("hostile/png-bytes.jpg"),
|
||||
htmlSsrf: p("documents/remote-img.html"),
|
||||
polyglot: p("image/hostile/png-bytes.jpg"),
|
||||
htmlSsrf: p("document/edge/remote-img.html"),
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user