From 1727a7a73e8b2bcd2a27b3fa33a46881087a7c7f Mon Sep 17 00:00:00 2001 From: SnapOtter Date: Sat, 20 Jun 2026 05:07:46 +0800 Subject: [PATCH] test: reorganize flat test files into purpose-based subdirectories (phase 6) Group 245 flat integration tests and 25 loose unit tests into discoverable subdirectories per spec section 6: integration/tools/{image,video,audio,document,data}/ (156 files) integration/platform/ (64 files) integration/generated/ (14 files) integration/security/ (10 files) unit/security/ (8 files, new subdir) unit/api/ (7 files moved in) unit/web/ (3 files moved in) unit/shared/ (6 files moved in) unit/image-engine/ (1 file moved in) All moves via git mv (history preserved). Relative imports repaired for both depth levels (platform/generated/security = +1, tools/ = +2): static from-imports, dynamic import() calls, vi.mock() paths, import.meta.dirname joins, and __dirname joins. Vitest discovery unchanged (no test.include in config, recursive glob matches subdirs, shard-by-hash unaffected). test-server.ts and tool-route-drift.test.ts stay at integration root. fixtures/ untouched. Parity gate: 13189 passing test names before = 13189 after (0 dropped). --- .../{ => generated}/catalog-integrity.test.ts | 8 +++---- .../{ => generated}/convert-formats.test.ts | 9 +++++-- .../{ => generated}/format-matrix-ai.test.ts | 9 +++++-- .../format-matrix-comprehensive.test.ts | 9 +++++-- .../format-matrix-exotic.test.ts | 9 +++++-- .../format-matrix-expanded.test.ts | 9 +++++-- .../format-matrix-generated.test.ts | 16 +++++++++---- .../format-matrix-multimodal.test.ts | 11 ++++++--- .../{ => generated}/format-matrix.test.ts | 9 +++++-- .../{ => generated}/fuzz-settings.test.ts | 8 +++---- .../{ => generated}/new-formats.test.ts | 9 +++++-- .../{ => generated}/settings-matrix.test.ts | 9 +++++-- .../{ => generated}/settings-pairwise.test.ts | 12 +++++----- .../{ => generated}/settings-phase1.test.ts | 2 +- .../{ => platform}/analytics.test.ts | 2 +- .../{ => platform}/anonymous-mode.test.ts | 6 ++--- .../{ => platform}/api-key-edge-cases.test.ts | 4 ++-- .../{ => platform}/api-key-scoping.test.ts | 4 ++-- tests/integration/{ => platform}/api.test.ts | 9 +++++-- .../{ => platform}/audit-export.test.ts | 4 ++-- .../audit-log-edge-cases.test.ts | 2 +- .../{ => platform}/audit-log.test.ts | 4 ++-- .../audit-tool-operations.test.ts | 11 ++++++--- .../{ => platform}/auth-edge-cases.test.ts | 4 ++-- .../integration/{ => platform}/batch.test.ts | 13 ++++++---- .../{ => platform}/cleanup.test.ts | 6 ++--- .../{ => platform}/concurrent.test.ts | 9 +++++-- .../config-export-import.test.ts | 16 ++++++------- .../cross-modality-smoke.test.ts | 9 +++++-- .../custom-roles-edge-cases.test.ts | 4 ++-- .../{ => platform}/custom-roles.test.ts | 4 ++-- .../{ => platform}/doc-engine-pdf-ops.test.ts | 2 +- .../{ => platform}/doc-engine-pdfcpu.test.ts | 2 +- .../{ => platform}/doc-engine.test.ts | 2 +- .../{ => platform}/docs-dispatcher.test.ts | 4 ++-- tests/integration/{ => platform}/docs.test.ts | 2 +- .../{ => platform}/download-range.test.ts | 4 ++-- .../{ => platform}/edge-cases.test.ts | 9 +++++-- .../{ => platform}/escalation.test.ts | 4 ++-- .../factory-multi-input.test.ts | 8 +++---- .../{ => platform}/feature-import.test.ts | 10 ++++---- .../{ => platform}/fetch-urls.test.ts | 4 ++-- .../{ => platform}/gdpr-lifecycle.test.ts | 4 ++-- .../ip-allowlist-routes.test.ts | 8 +++---- .../{ => platform}/job-spine.test.ts | 16 ++++++------- .../{ => platform}/jobs-schema.test.ts | 2 +- .../{ => platform}/legal-hold.test.ts | 4 ++-- .../{ => platform}/media-engine.test.ts | 2 +- .../{ => platform}/mfa-endpoints.test.ts | 8 +++---- .../migrate-from-sqlite.test.ts | 4 ++-- .../{ => platform}/modality-input.test.ts | 12 +++++----- .../modality-media-kinds.test.ts | 4 ++-- .../{ => platform}/observability.test.ts | 2 +- .../{ => platform}/oidc-auth.test.ts | 8 +++---- .../ownership-enforcement.test.ts | 13 +++++++--- .../{ => platform}/permissions.test.ts | 15 ++++++++---- .../pipeline-edge-cases.test.ts | 9 +++++-- .../{ => platform}/pool-routing.test.ts | 2 +- .../{ => platform}/preview-modality.test.ts | 4 ++-- .../{ => platform}/process-contract.test.ts | 12 +++++----- .../{ => platform}/progress-transport.test.ts | 8 +++---- .../{ => platform}/progress.test.ts | 16 +++++++++---- .../{ => platform}/rbac-matrix-full.test.ts | 4 ++-- .../{ => platform}/rbac-matrix.test.ts | 4 ++-- .../{ => platform}/s3-storage.test.ts | 24 ++++++++++--------- tests/integration/{ => platform}/scim.test.ts | 6 ++--- .../{ => platform}/siem-config.test.ts | 8 +++---- .../{ => platform}/siem-forwarding.test.ts | 2 +- .../{ => platform}/support-bundle.test.ts | 6 ++--- .../{ => platform}/system-jobs.test.ts | 14 +++++------ .../integration/{ => platform}/teams.test.ts | 4 ++-- .../{ => platform}/tool-async-window.test.ts | 13 ++++++---- .../{ => platform}/tracing-lifecycle.test.ts | 0 .../{ => platform}/upgrade-management.test.ts | 8 +++---- .../{ => platform}/usage-endpoint.test.ts | 4 ++-- .../{ => platform}/user-files.test.ts | 9 +++++-- .../{ => platform}/webhook-management.test.ts | 8 +++---- .../{ => platform}/worker-timeout.test.ts | 22 ++++++++--------- .../adversarial-comprehensive.test.ts | 9 +++++-- .../adversarial-coverage-gaps.test.ts | 9 +++++-- .../adversarial-extended.test.ts | 9 +++++-- .../adversarial-final-gaps.test.ts | 9 +++++-- .../{ => security}/adversarial-matrix.test.ts | 9 +++++-- .../adversarial-security.test.ts | 9 +++++-- .../{ => security}/adversarial.test.ts | 9 +++++-- .../{ => security}/hostile-inputs.test.ts | 11 ++++++--- .../security-auth-hardening.test.ts | 4 ++-- .../security-rate-limiting.test.ts | 9 +++++-- .../{ => tools/audio}/audio-channels.test.ts | 9 +++++-- .../{ => tools/audio}/audio-metadata.test.ts | 9 +++++-- .../{ => tools/audio}/audio-speed.test.ts | 9 +++++-- .../{ => tools/audio}/convert-audio.test.ts | 9 +++++-- .../{ => tools/audio}/fade-audio.test.ts | 9 +++++-- .../{ => tools/audio}/merge-audio.test.ts | 9 +++++-- .../{ => tools/audio}/noise-reduction.test.ts | 9 +++++-- .../{ => tools/audio}/normalize-audio.test.ts | 9 +++++-- .../{ => tools/audio}/pitch-shift.test.ts | 9 +++++-- .../{ => tools/audio}/reverse-audio.test.ts | 9 +++++-- .../{ => tools/audio}/ringtone-maker.test.ts | 9 +++++-- .../{ => tools/audio}/silence-removal.test.ts | 9 +++++-- .../{ => tools/audio}/split-audio.test.ts | 9 +++++-- .../audio}/transcribe-audio.test.ts | 9 +++++-- .../{ => tools/audio}/trim-audio.test.ts | 9 +++++-- .../{ => tools/audio}/volume-adjust.test.ts | 9 +++++-- .../{ => tools/audio}/waveform-image.test.ts | 9 +++++-- .../{ => tools/data}/chart-maker.test.ts | 7 +++++- .../{ => tools/data}/create-zip.test.ts | 9 +++++-- .../{ => tools/data}/csv-excel.test.ts | 9 +++++-- .../{ => tools/data}/csv-json.test.ts | 9 +++++-- .../{ => tools/data}/extract-zip.test.ts | 9 +++++-- .../{ => tools/data}/json-xml.test.ts | 9 +++++-- .../{ => tools/data}/merge-csvs.test.ts | 9 +++++-- .../{ => tools/data}/split-csv.test.ts | 9 +++++-- .../{ => tools/data}/xml-to-csv.test.ts | 7 +++++- .../{ => tools/data}/yaml-json.test.ts | 9 +++++-- .../{ => tools/document}/booklet-pdf.test.ts | 9 +++++-- .../{ => tools/document}/compress-pdf.test.ts | 9 +++++-- .../document}/convert-document.test.ts | 11 ++++++--- .../document}/convert-presentation.test.ts | 11 ++++++--- .../document}/convert-spreadsheet.test.ts | 11 ++++++--- .../{ => tools/document}/crop-pdf.test.ts | 9 +++++-- .../{ => tools/document}/epub-convert.test.ts | 17 ++++++++----- .../{ => tools/document}/excel-to-pdf.test.ts | 11 ++++++--- .../document}/extract-pages.test.ts | 9 +++++-- .../{ => tools/document}/flatten-pdf.test.ts | 11 ++++++--- .../document}/grayscale-pdf.test.ts | 9 +++++-- .../{ => tools/document}/html-to-pdf.test.ts | 15 ++++++++---- .../document}/linearize-pdf.test.ts | 9 +++++-- .../document}/markdown-to-docx.test.ts | 9 +++++-- .../document}/markdown-to-html.test.ts | 9 +++++-- .../document}/markdown-to-pdf.test.ts | 13 ++++++---- .../{ => tools/document}/merge-pdf.test.ts | 9 +++++-- .../{ => tools/document}/nup-pdf.test.ts | 9 +++++-- .../{ => tools/document}/ocr-pdf.test.ts | 9 +++++-- .../{ => tools/document}/organize-pdf.test.ts | 9 +++++-- .../{ => tools/document}/pdf-metadata.test.ts | 11 ++++++--- .../document}/pdf-page-numbers.test.ts | 9 +++++-- .../{ => tools/document}/pdf-to-image.test.ts | 9 +++++-- .../{ => tools/document}/pdf-to-text.test.ts | 11 ++++++--- .../{ => tools/document}/pdf-to-word.test.ts | 13 ++++++---- .../{ => tools/document}/pdfa-convert.test.ts | 9 +++++-- .../document}/powerpoint-to-pdf.test.ts | 11 ++++++--- .../{ => tools/document}/protect-pdf.test.ts | 11 ++++++--- .../{ => tools/document}/redact-pdf.test.ts | 11 ++++++--- .../{ => tools/document}/remove-pages.test.ts | 9 +++++-- .../{ => tools/document}/repair-pdf.test.ts | 9 +++++-- .../{ => tools/document}/rotate-pdf.test.ts | 9 +++++-- .../{ => tools/document}/split-pdf.test.ts | 9 +++++-- .../{ => tools/document}/to-epub.test.ts | 11 ++++++--- .../{ => tools/document}/unlock-pdf.test.ts | 11 ++++++--- .../document}/watermark-pdf.test.ts | 9 +++++-- .../{ => tools/document}/word-to-pdf.test.ts | 11 ++++++--- .../image}/ai-canvas-expand.test.ts | 9 +++++-- .../image}/background-replace.test.ts | 9 +++++-- .../image}/barcode-generate.test.ts | 2 +- .../{ => tools/image}/barcode-read.test.ts | 9 +++++-- .../{ => tools/image}/beautify.test.ts | 9 +++++-- .../{ => tools/image}/blur-background.test.ts | 9 +++++-- .../{ => tools/image}/blur-faces.test.ts | 9 +++++-- .../{ => tools/image}/border.test.ts | 9 +++++-- .../{ => tools/image}/bulk-rename.test.ts | 9 +++++-- .../{ => tools/image}/circle-crop.test.ts | 9 +++++-- .../{ => tools/image}/collage.test.ts | 9 +++++-- .../image}/color-adjustments.test.ts | 9 +++++-- .../{ => tools/image}/color-blindness.test.ts | 9 +++++-- .../{ => tools/image}/color-palette.test.ts | 9 +++++-- .../{ => tools/image}/colorize.test.ts | 9 +++++-- .../{ => tools/image}/compare.test.ts | 9 +++++-- .../{ => tools/image}/compose.test.ts | 9 +++++-- .../{ => tools/image}/compress.test.ts | 9 +++++-- .../image}/content-aware-resize.test.ts | 9 +++++-- .../{ => tools/image}/crop.test.ts | 9 +++++-- .../{ => tools/image}/duotone.test.ts | 7 +++++- .../{ => tools/image}/edit-metadata.test.ts | 9 +++++-- .../{ => tools/image}/enhance-faces.test.ts | 9 +++++-- .../{ => tools/image}/erase-object.test.ts | 9 +++++-- .../{ => tools/image}/favicon.test.ts | 9 +++++-- .../{ => tools/image}/find-duplicates.test.ts | 9 +++++-- .../{ => tools/image}/gif-tools.test.ts | 9 +++++-- .../{ => tools/image}/gif-webp.test.ts | 9 +++++-- .../{ => tools/image}/histogram.test.ts | 9 +++++-- .../{ => tools/image}/html-to-image.test.ts | 20 +++++++++------- .../image}/image-enhancement.test.ts | 9 +++++-- .../{ => tools/image}/image-pad.test.ts | 11 ++++++--- .../{ => tools/image}/image-to-base64.test.ts | 9 +++++-- .../{ => tools/image}/image-to-pdf.test.ts | 9 +++++-- .../{ => tools/image}/info.test.ts | 9 +++++-- .../image}/lqip-placeholder.test.ts | 9 +++++-- .../{ => tools/image}/meme-generator.test.ts | 9 +++++-- .../{ => tools/image}/noise-removal.test.ts | 9 +++++-- .../integration/{ => tools/image}/ocr.test.ts | 9 +++++-- .../image}/optimize-for-web.test.ts | 9 +++++-- .../{ => tools/image}/passport-photo.test.ts | 9 +++++-- .../{ => tools/image}/pixelate.test.ts | 9 +++++-- .../{ => tools/image}/qr-generate.test.ts | 2 +- .../{ => tools/image}/red-eye-removal.test.ts | 9 +++++-- .../image}/remove-background.test.ts | 9 +++++-- .../{ => tools/image}/replace-color.test.ts | 9 +++++-- .../{ => tools/image}/resize.test.ts | 9 +++++-- .../{ => tools/image}/restore-photo.test.ts | 9 +++++-- .../{ => tools/image}/rotate.test.ts | 9 +++++-- .../{ => tools/image}/sharpening.test.ts | 9 +++++-- .../{ => tools/image}/smart-crop.test.ts | 9 +++++-- .../{ => tools/image}/split.test.ts | 9 +++++-- .../{ => tools/image}/sprite-sheet.test.ts | 9 +++++-- .../{ => tools/image}/stitch.test.ts | 9 +++++-- .../{ => tools/image}/strip-metadata.test.ts | 9 +++++-- .../{ => tools/image}/svg-to-raster.test.ts | 9 +++++-- .../{ => tools/image}/text-overlay.test.ts | 9 +++++-- .../image}/transparency-fixer.test.ts | 9 +++++-- .../{ => tools/image}/upscale.test.ts | 9 +++++-- .../{ => tools/image}/vectorize.test.ts | 9 +++++-- .../{ => tools/image}/vignette.test.ts | 9 +++++-- .../{ => tools/image}/watermark-image.test.ts | 9 +++++-- .../{ => tools/image}/watermark-text.test.ts | 9 +++++-- .../{ => tools/video}/aspect-pad.test.ts | 11 ++++++--- .../{ => tools/video}/auto-subtitles.test.ts | 9 +++++-- .../{ => tools/video}/blur-pad.test.ts | 11 ++++++--- .../{ => tools/video}/burn-subtitles.test.ts | 11 ++++++--- .../{ => tools/video}/change-fps.test.ts | 9 +++++-- .../{ => tools/video}/compress-video.test.ts | 11 ++++++--- .../{ => tools/video}/convert-video.test.ts | 13 ++++++---- .../{ => tools/video}/crop-video.test.ts | 9 +++++-- .../{ => tools/video}/embed-subtitles.test.ts | 9 +++++-- .../{ => tools/video}/extract-audio.test.ts | 9 +++++-- .../video}/extract-subtitles.test.ts | 9 +++++-- .../{ => tools/video}/gif-to-video.test.ts | 9 +++++-- .../{ => tools/video}/images-to-video.test.ts | 9 +++++-- .../{ => tools/video}/merge-videos.test.ts | 13 ++++++---- .../{ => tools/video}/mute-video.test.ts | 9 +++++-- .../{ => tools/video}/replace-audio.test.ts | 9 +++++-- .../{ => tools/video}/resize-video.test.ts | 9 +++++-- .../{ => tools/video}/reverse-video.test.ts | 9 +++++-- .../{ => tools/video}/rotate-video.test.ts | 9 +++++-- .../{ => tools/video}/stabilize-video.test.ts | 11 ++++++--- .../{ => tools/video}/trim-video.test.ts | 9 +++++-- .../{ => tools/video}/video-color.test.ts | 9 +++++-- .../{ => tools/video}/video-loudnorm.test.ts | 9 +++++-- .../{ => tools/video}/video-metadata.test.ts | 9 +++++-- .../{ => tools/video}/video-speed.test.ts | 9 +++++-- .../{ => tools/video}/video-to-frames.test.ts | 9 +++++-- .../{ => tools/video}/video-to-gif.test.ts | 11 ++++++--- .../{ => tools/video}/video-to-webp.test.ts | 9 +++++-- .../{ => tools/video}/watermark-video.test.ts | 9 +++++-- .../{ => api}/beautify-backgrounds.test.ts | 2 +- tests/unit/{ => api}/beautify-frames.test.ts | 2 +- tests/unit/{ => api}/beautify-shadow.test.ts | 2 +- tests/unit/{ => api}/errors-friendly.test.ts | 2 +- tests/unit/{ => api}/meme-templates.test.ts | 2 +- tests/unit/{ => api}/pdf-to-image.test.ts | 2 +- .../unit/{ => api}/venv-upgrade-stamp.test.ts | 0 .../{ => image-engine}/auto-enhance.test.ts | 2 +- .../docker-file-secrets.test.ts | 0 .../security-auth-hardening.test.ts | 6 ++--- .../security-error-handling.test.ts | 2 +- .../security-file-processing.test.ts | 0 .../security-input-validation.test.ts | 4 ++-- .../{ => security}/security-network.test.ts | 4 ++-- .../security-rate-limiting.test.ts | 0 .../security-svg-sanitize.test.ts | 2 +- .../analytics-consent-extended.test.ts | 0 .../{ => shared}/analytics-consent.test.ts | 0 .../{ => shared}/analytics-events.test.ts | 0 .../unit/{ => shared}/analytics-types.test.ts | 0 tests/unit/{ => shared}/features.test.ts | 0 tests/unit/{ => shared}/pairwise.test.ts | 2 +- .../{ => web}/pipeline-step-summary.test.ts | 2 +- tests/unit/{ => web}/pipeline-store.test.ts | 2 +- tests/unit/{ => web}/use-focus-trap.test.ts | 2 +- 269 files changed, 1553 insertions(+), 619 deletions(-) rename tests/integration/{ => generated}/catalog-integrity.test.ts (93%) rename tests/integration/{ => generated}/convert-formats.test.ts (98%) rename tests/integration/{ => generated}/format-matrix-ai.test.ts (99%) rename tests/integration/{ => generated}/format-matrix-comprehensive.test.ts (99%) rename tests/integration/{ => generated}/format-matrix-exotic.test.ts (99%) rename tests/integration/{ => generated}/format-matrix-expanded.test.ts (99%) rename tests/integration/{ => generated}/format-matrix-generated.test.ts (93%) rename tests/integration/{ => generated}/format-matrix-multimodal.test.ts (97%) rename tests/integration/{ => generated}/format-matrix.test.ts (99%) rename tests/integration/{ => generated}/fuzz-settings.test.ts (92%) rename tests/integration/{ => generated}/new-formats.test.ts (98%) rename tests/integration/{ => generated}/settings-matrix.test.ts (99%) rename tests/integration/{ => generated}/settings-pairwise.test.ts (89%) rename tests/integration/{ => generated}/settings-phase1.test.ts (99%) rename tests/integration/{ => platform}/analytics.test.ts (99%) rename tests/integration/{ => platform}/anonymous-mode.test.ts (96%) rename tests/integration/{ => platform}/api-key-edge-cases.test.ts (98%) rename tests/integration/{ => platform}/api-key-scoping.test.ts (97%) rename tests/integration/{ => platform}/api.test.ts (99%) rename tests/integration/{ => platform}/audit-export.test.ts (96%) rename tests/integration/{ => platform}/audit-log-edge-cases.test.ts (98%) rename tests/integration/{ => platform}/audit-log.test.ts (95%) rename tests/integration/{ => platform}/audit-tool-operations.test.ts (93%) rename tests/integration/{ => platform}/auth-edge-cases.test.ts (99%) rename tests/integration/{ => platform}/batch.test.ts (98%) rename tests/integration/{ => platform}/cleanup.test.ts (92%) rename tests/integration/{ => platform}/concurrent.test.ts (99%) rename tests/integration/{ => platform}/config-export-import.test.ts (94%) rename tests/integration/{ => platform}/cross-modality-smoke.test.ts (97%) rename tests/integration/{ => platform}/custom-roles-edge-cases.test.ts (98%) rename tests/integration/{ => platform}/custom-roles.test.ts (97%) rename tests/integration/{ => platform}/doc-engine-pdf-ops.test.ts (99%) rename tests/integration/{ => platform}/doc-engine-pdfcpu.test.ts (99%) rename tests/integration/{ => platform}/doc-engine.test.ts (96%) rename tests/integration/{ => platform}/docs-dispatcher.test.ts (95%) rename tests/integration/{ => platform}/docs.test.ts (96%) rename tests/integration/{ => platform}/download-range.test.ts (96%) rename tests/integration/{ => platform}/edge-cases.test.ts (99%) rename tests/integration/{ => platform}/escalation.test.ts (98%) rename tests/integration/{ => platform}/factory-multi-input.test.ts (97%) rename tests/integration/{ => platform}/feature-import.test.ts (98%) rename tests/integration/{ => platform}/fetch-urls.test.ts (98%) rename tests/integration/{ => platform}/gdpr-lifecycle.test.ts (98%) rename tests/integration/{ => platform}/ip-allowlist-routes.test.ts (95%) rename tests/integration/{ => platform}/job-spine.test.ts (90%) rename tests/integration/{ => platform}/jobs-schema.test.ts (95%) rename tests/integration/{ => platform}/legal-hold.test.ts (97%) rename tests/integration/{ => platform}/media-engine.test.ts (97%) rename tests/integration/{ => platform}/mfa-endpoints.test.ts (96%) rename tests/integration/{ => platform}/migrate-from-sqlite.test.ts (99%) rename tests/integration/{ => platform}/modality-input.test.ts (90%) rename tests/integration/{ => platform}/modality-media-kinds.test.ts (91%) rename tests/integration/{ => platform}/observability.test.ts (97%) rename tests/integration/{ => platform}/oidc-auth.test.ts (99%) rename tests/integration/{ => platform}/ownership-enforcement.test.ts (97%) rename tests/integration/{ => platform}/permissions.test.ts (98%) rename tests/integration/{ => platform}/pipeline-edge-cases.test.ts (99%) rename tests/integration/{ => platform}/pool-routing.test.ts (87%) rename tests/integration/{ => platform}/preview-modality.test.ts (83%) rename tests/integration/{ => platform}/process-contract.test.ts (93%) rename tests/integration/{ => platform}/progress-transport.test.ts (94%) rename tests/integration/{ => platform}/progress.test.ts (98%) rename tests/integration/{ => platform}/rbac-matrix-full.test.ts (98%) rename tests/integration/{ => platform}/rbac-matrix.test.ts (96%) rename tests/integration/{ => platform}/s3-storage.test.ts (87%) rename tests/integration/{ => platform}/scim.test.ts (98%) rename tests/integration/{ => platform}/siem-config.test.ts (96%) rename tests/integration/{ => platform}/siem-forwarding.test.ts (94%) rename tests/integration/{ => platform}/support-bundle.test.ts (94%) rename tests/integration/{ => platform}/system-jobs.test.ts (95%) rename tests/integration/{ => platform}/teams.test.ts (98%) rename tests/integration/{ => platform}/tool-async-window.test.ts (95%) rename tests/integration/{ => platform}/tracing-lifecycle.test.ts (100%) rename tests/integration/{ => platform}/upgrade-management.test.ts (96%) rename tests/integration/{ => platform}/usage-endpoint.test.ts (97%) rename tests/integration/{ => platform}/user-files.test.ts (99%) rename tests/integration/{ => platform}/webhook-management.test.ts (97%) rename tests/integration/{ => platform}/worker-timeout.test.ts (83%) rename tests/integration/{ => security}/adversarial-comprehensive.test.ts (99%) rename tests/integration/{ => security}/adversarial-coverage-gaps.test.ts (99%) rename tests/integration/{ => security}/adversarial-extended.test.ts (99%) rename tests/integration/{ => security}/adversarial-final-gaps.test.ts (99%) rename tests/integration/{ => security}/adversarial-matrix.test.ts (99%) rename tests/integration/{ => security}/adversarial-security.test.ts (99%) rename tests/integration/{ => security}/adversarial.test.ts (99%) rename tests/integration/{ => security}/hostile-inputs.test.ts (94%) rename tests/integration/{ => security}/security-auth-hardening.test.ts (97%) rename tests/integration/{ => security}/security-rate-limiting.test.ts (96%) rename tests/integration/{ => tools/audio}/audio-channels.test.ts (94%) rename tests/integration/{ => tools/audio}/audio-metadata.test.ts (93%) rename tests/integration/{ => tools/audio}/audio-speed.test.ts (91%) rename tests/integration/{ => tools/audio}/convert-audio.test.ts (92%) rename tests/integration/{ => tools/audio}/fade-audio.test.ts (89%) rename tests/integration/{ => tools/audio}/merge-audio.test.ts (93%) rename tests/integration/{ => tools/audio}/noise-reduction.test.ts (90%) rename tests/integration/{ => tools/audio}/normalize-audio.test.ts (88%) rename tests/integration/{ => tools/audio}/pitch-shift.test.ts (91%) rename tests/integration/{ => tools/audio}/reverse-audio.test.ts (92%) rename tests/integration/{ => tools/audio}/ringtone-maker.test.ts (89%) rename tests/integration/{ => tools/audio}/silence-removal.test.ts (91%) rename tests/integration/{ => tools/audio}/split-audio.test.ts (96%) rename tests/integration/{ => tools/audio}/transcribe-audio.test.ts (96%) rename tests/integration/{ => tools/audio}/trim-audio.test.ts (92%) rename tests/integration/{ => tools/audio}/volume-adjust.test.ts (91%) rename tests/integration/{ => tools/audio}/waveform-image.test.ts (90%) rename tests/integration/{ => tools/data}/chart-maker.test.ts (98%) rename tests/integration/{ => tools/data}/create-zip.test.ts (92%) rename tests/integration/{ => tools/data}/csv-excel.test.ts (94%) rename tests/integration/{ => tools/data}/csv-json.test.ts (94%) rename tests/integration/{ => tools/data}/extract-zip.test.ts (96%) rename tests/integration/{ => tools/data}/json-xml.test.ts (92%) rename tests/integration/{ => tools/data}/merge-csvs.test.ts (94%) rename tests/integration/{ => tools/data}/split-csv.test.ts (95%) rename tests/integration/{ => tools/data}/xml-to-csv.test.ts (95%) rename tests/integration/{ => tools/data}/yaml-json.test.ts (93%) rename tests/integration/{ => tools/document}/booklet-pdf.test.ts (89%) rename tests/integration/{ => tools/document}/compress-pdf.test.ts (91%) rename tests/integration/{ => tools/document}/convert-document.test.ts (93%) rename tests/integration/{ => tools/document}/convert-presentation.test.ts (91%) rename tests/integration/{ => tools/document}/convert-spreadsheet.test.ts (93%) rename tests/integration/{ => tools/document}/crop-pdf.test.ts (89%) rename tests/integration/{ => tools/document}/epub-convert.test.ts (94%) rename tests/integration/{ => tools/document}/excel-to-pdf.test.ts (91%) rename tests/integration/{ => tools/document}/extract-pages.test.ts (91%) rename tests/integration/{ => tools/document}/flatten-pdf.test.ts (84%) rename tests/integration/{ => tools/document}/grayscale-pdf.test.ts (88%) rename tests/integration/{ => tools/document}/html-to-pdf.test.ts (88%) rename tests/integration/{ => tools/document}/linearize-pdf.test.ts (90%) rename tests/integration/{ => tools/document}/markdown-to-docx.test.ts (92%) rename tests/integration/{ => tools/document}/markdown-to-html.test.ts (92%) rename tests/integration/{ => tools/document}/markdown-to-pdf.test.ts (88%) rename tests/integration/{ => tools/document}/merge-pdf.test.ts (93%) rename tests/integration/{ => tools/document}/nup-pdf.test.ts (89%) rename tests/integration/{ => tools/document}/ocr-pdf.test.ts (95%) rename tests/integration/{ => tools/document}/organize-pdf.test.ts (91%) rename tests/integration/{ => tools/document}/pdf-metadata.test.ts (88%) rename tests/integration/{ => tools/document}/pdf-page-numbers.test.ts (88%) rename tests/integration/{ => tools/document}/pdf-to-image.test.ts (99%) rename tests/integration/{ => tools/document}/pdf-to-text.test.ts (85%) rename tests/integration/{ => tools/document}/pdf-to-word.test.ts (87%) rename tests/integration/{ => tools/document}/pdfa-convert.test.ts (88%) rename tests/integration/{ => tools/document}/powerpoint-to-pdf.test.ts (91%) rename tests/integration/{ => tools/document}/protect-pdf.test.ts (91%) rename tests/integration/{ => tools/document}/redact-pdf.test.ts (88%) rename tests/integration/{ => tools/document}/remove-pages.test.ts (96%) rename tests/integration/{ => tools/document}/repair-pdf.test.ts (94%) rename tests/integration/{ => tools/document}/rotate-pdf.test.ts (92%) rename tests/integration/{ => tools/document}/split-pdf.test.ts (94%) rename tests/integration/{ => tools/document}/to-epub.test.ts (91%) rename tests/integration/{ => tools/document}/unlock-pdf.test.ts (91%) rename tests/integration/{ => tools/document}/watermark-pdf.test.ts (90%) rename tests/integration/{ => tools/document}/word-to-pdf.test.ts (89%) rename tests/integration/{ => tools/image}/ai-canvas-expand.test.ts (98%) rename tests/integration/{ => tools/image}/background-replace.test.ts (97%) rename tests/integration/{ => tools/image}/barcode-generate.test.ts (99%) rename tests/integration/{ => tools/image}/barcode-read.test.ts (99%) rename tests/integration/{ => tools/image}/beautify.test.ts (99%) rename tests/integration/{ => tools/image}/blur-background.test.ts (97%) rename tests/integration/{ => tools/image}/blur-faces.test.ts (97%) rename tests/integration/{ => tools/image}/border.test.ts (99%) rename tests/integration/{ => tools/image}/bulk-rename.test.ts (99%) rename tests/integration/{ => tools/image}/circle-crop.test.ts (97%) rename tests/integration/{ => tools/image}/collage.test.ts (99%) rename tests/integration/{ => tools/image}/color-adjustments.test.ts (99%) rename tests/integration/{ => tools/image}/color-blindness.test.ts (98%) rename tests/integration/{ => tools/image}/color-palette.test.ts (99%) rename tests/integration/{ => tools/image}/colorize.test.ts (97%) rename tests/integration/{ => tools/image}/compare.test.ts (99%) rename tests/integration/{ => tools/image}/compose.test.ts (99%) rename tests/integration/{ => tools/image}/compress.test.ts (98%) rename tests/integration/{ => tools/image}/content-aware-resize.test.ts (99%) rename tests/integration/{ => tools/image}/crop.test.ts (98%) rename tests/integration/{ => tools/image}/duotone.test.ts (98%) rename tests/integration/{ => tools/image}/edit-metadata.test.ts (99%) rename tests/integration/{ => tools/image}/enhance-faces.test.ts (97%) rename tests/integration/{ => tools/image}/erase-object.test.ts (98%) rename tests/integration/{ => tools/image}/favicon.test.ts (99%) rename tests/integration/{ => tools/image}/find-duplicates.test.ts (99%) rename tests/integration/{ => tools/image}/gif-tools.test.ts (99%) rename tests/integration/{ => tools/image}/gif-webp.test.ts (96%) rename tests/integration/{ => tools/image}/histogram.test.ts (95%) rename tests/integration/{ => tools/image}/html-to-image.test.ts (93%) rename tests/integration/{ => tools/image}/image-enhancement.test.ts (99%) rename tests/integration/{ => tools/image}/image-pad.test.ts (96%) rename tests/integration/{ => tools/image}/image-to-base64.test.ts (99%) rename tests/integration/{ => tools/image}/image-to-pdf.test.ts (99%) rename tests/integration/{ => tools/image}/info.test.ts (99%) rename tests/integration/{ => tools/image}/lqip-placeholder.test.ts (95%) rename tests/integration/{ => tools/image}/meme-generator.test.ts (99%) rename tests/integration/{ => tools/image}/noise-removal.test.ts (97%) rename tests/integration/{ => tools/image}/ocr.test.ts (97%) rename tests/integration/{ => tools/image}/optimize-for-web.test.ts (99%) rename tests/integration/{ => tools/image}/passport-photo.test.ts (98%) rename tests/integration/{ => tools/image}/pixelate.test.ts (96%) rename tests/integration/{ => tools/image}/qr-generate.test.ts (99%) rename tests/integration/{ => tools/image}/red-eye-removal.test.ts (98%) rename tests/integration/{ => tools/image}/remove-background.test.ts (98%) rename tests/integration/{ => tools/image}/replace-color.test.ts (99%) rename tests/integration/{ => tools/image}/resize.test.ts (97%) rename tests/integration/{ => tools/image}/restore-photo.test.ts (98%) rename tests/integration/{ => tools/image}/rotate.test.ts (97%) rename tests/integration/{ => tools/image}/sharpening.test.ts (99%) rename tests/integration/{ => tools/image}/smart-crop.test.ts (98%) rename tests/integration/{ => tools/image}/split.test.ts (99%) rename tests/integration/{ => tools/image}/sprite-sheet.test.ts (96%) rename tests/integration/{ => tools/image}/stitch.test.ts (99%) rename tests/integration/{ => tools/image}/strip-metadata.test.ts (99%) rename tests/integration/{ => tools/image}/svg-to-raster.test.ts (99%) rename tests/integration/{ => tools/image}/text-overlay.test.ts (99%) rename tests/integration/{ => tools/image}/transparency-fixer.test.ts (98%) rename tests/integration/{ => tools/image}/upscale.test.ts (98%) rename tests/integration/{ => tools/image}/vectorize.test.ts (99%) rename tests/integration/{ => tools/image}/vignette.test.ts (96%) rename tests/integration/{ => tools/image}/watermark-image.test.ts (99%) rename tests/integration/{ => tools/image}/watermark-text.test.ts (99%) rename tests/integration/{ => tools/video}/aspect-pad.test.ts (92%) rename tests/integration/{ => tools/video}/auto-subtitles.test.ts (96%) rename tests/integration/{ => tools/video}/blur-pad.test.ts (91%) rename tests/integration/{ => tools/video}/burn-subtitles.test.ts (95%) rename tests/integration/{ => tools/video}/change-fps.test.ts (95%) rename tests/integration/{ => tools/video}/compress-video.test.ts (89%) rename tests/integration/{ => tools/video}/convert-video.test.ts (91%) rename tests/integration/{ => tools/video}/crop-video.test.ts (92%) rename tests/integration/{ => tools/video}/embed-subtitles.test.ts (93%) rename tests/integration/{ => tools/video}/extract-audio.test.ts (92%) rename tests/integration/{ => tools/video}/extract-subtitles.test.ts (92%) rename tests/integration/{ => tools/video}/gif-to-video.test.ts (93%) rename tests/integration/{ => tools/video}/images-to-video.test.ts (94%) rename tests/integration/{ => tools/video}/merge-videos.test.ts (93%) rename tests/integration/{ => tools/video}/mute-video.test.ts (91%) rename tests/integration/{ => tools/video}/replace-audio.test.ts (95%) rename tests/integration/{ => tools/video}/resize-video.test.ts (91%) rename tests/integration/{ => tools/video}/reverse-video.test.ts (92%) rename tests/integration/{ => tools/video}/rotate-video.test.ts (92%) rename tests/integration/{ => tools/video}/stabilize-video.test.ts (92%) rename tests/integration/{ => tools/video}/trim-video.test.ts (93%) rename tests/integration/{ => tools/video}/video-color.test.ts (89%) rename tests/integration/{ => tools/video}/video-loudnorm.test.ts (93%) rename tests/integration/{ => tools/video}/video-metadata.test.ts (91%) rename tests/integration/{ => tools/video}/video-speed.test.ts (95%) rename tests/integration/{ => tools/video}/video-to-frames.test.ts (93%) rename tests/integration/{ => tools/video}/video-to-gif.test.ts (88%) rename tests/integration/{ => tools/video}/video-to-webp.test.ts (90%) rename tests/integration/{ => tools/video}/watermark-video.test.ts (93%) rename tests/unit/{ => api}/beautify-backgrounds.test.ts (98%) rename tests/unit/{ => api}/beautify-frames.test.ts (98%) rename tests/unit/{ => api}/beautify-shadow.test.ts (96%) rename tests/unit/{ => api}/errors-friendly.test.ts (97%) rename tests/unit/{ => api}/meme-templates.test.ts (98%) rename tests/unit/{ => api}/pdf-to-image.test.ts (95%) rename tests/unit/{ => api}/venv-upgrade-stamp.test.ts (100%) rename tests/unit/{ => image-engine}/auto-enhance.test.ts (99%) rename tests/unit/{ => security}/docker-file-secrets.test.ts (100%) rename tests/unit/{ => security}/security-auth-hardening.test.ts (96%) rename tests/unit/{ => security}/security-error-handling.test.ts (97%) rename tests/unit/{ => security}/security-file-processing.test.ts (100%) rename tests/unit/{ => security}/security-input-validation.test.ts (98%) rename tests/unit/{ => security}/security-network.test.ts (97%) rename tests/unit/{ => security}/security-rate-limiting.test.ts (100%) rename tests/unit/{ => security}/security-svg-sanitize.test.ts (99%) rename tests/unit/{ => shared}/analytics-consent-extended.test.ts (100%) rename tests/unit/{ => shared}/analytics-consent.test.ts (100%) rename tests/unit/{ => shared}/analytics-events.test.ts (100%) rename tests/unit/{ => shared}/analytics-types.test.ts (100%) rename tests/unit/{ => shared}/features.test.ts (100%) rename tests/unit/{ => shared}/pairwise.test.ts (97%) rename tests/unit/{ => web}/pipeline-step-summary.test.ts (95%) rename tests/unit/{ => web}/pipeline-store.test.ts (97%) rename tests/unit/{ => web}/use-focus-trap.test.ts (70%) diff --git a/tests/integration/catalog-integrity.test.ts b/tests/integration/generated/catalog-integrity.test.ts similarity index 93% rename from tests/integration/catalog-integrity.test.ts rename to tests/integration/generated/catalog-integrity.test.ts index d359d2d5..66a9e4fe 100644 --- a/tests/integration/catalog-integrity.test.ts +++ b/tests/integration/generated/catalog-integrity.test.ts @@ -17,10 +17,10 @@ import { TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { getRegisteredToolIds } from "../../apps/api/src/routes/tool-factory.js"; -import { TOOL_DISPLAY_MODES } from "../../apps/web/src/lib/tool-display-modes.js"; -import { toolRegistry } from "../../apps/web/src/lib/tool-registry.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { getRegisteredToolIds } from "../../../apps/api/src/routes/tool-factory.js"; +import { TOOL_DISPLAY_MODES } from "../../../apps/web/src/lib/tool-display-modes.js"; +import { toolRegistry } from "../../../apps/web/src/lib/tool-registry.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; /** * Tools whose contract does not fit the single-buffer process fn (multi-file, diff --git a/tests/integration/convert-formats.test.ts b/tests/integration/generated/convert-formats.test.ts similarity index 98% rename from tests/integration/convert-formats.test.ts rename to tests/integration/generated/convert-formats.test.ts index 013bb6be..2d3dfabc 100644 --- a/tests/integration/convert-formats.test.ts +++ b/tests/integration/generated/convert-formats.test.ts @@ -12,8 +12,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // All output formats accepted by the convert tool const OUTPUT_FORMATS = [ diff --git a/tests/integration/format-matrix-ai.test.ts b/tests/integration/generated/format-matrix-ai.test.ts similarity index 99% rename from tests/integration/format-matrix-ai.test.ts rename to tests/integration/generated/format-matrix-ai.test.ts index e48d701d..ae70531c 100644 --- a/tests/integration/format-matrix-ai.test.ts +++ b/tests/integration/generated/format-matrix-ai.test.ts @@ -20,8 +20,13 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Format sample definitions (matches format-matrix.test.ts) diff --git a/tests/integration/format-matrix-comprehensive.test.ts b/tests/integration/generated/format-matrix-comprehensive.test.ts similarity index 99% rename from tests/integration/format-matrix-comprehensive.test.ts rename to tests/integration/generated/format-matrix-comprehensive.test.ts index 5bca0c8a..84ef7dc9 100644 --- a/tests/integration/format-matrix-comprehensive.test.ts +++ b/tests/integration/generated/format-matrix-comprehensive.test.ts @@ -28,8 +28,13 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { fixtureDir } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; vi.setConfig({ testTimeout: 60_000 }); diff --git a/tests/integration/format-matrix-exotic.test.ts b/tests/integration/generated/format-matrix-exotic.test.ts similarity index 99% rename from tests/integration/format-matrix-exotic.test.ts rename to tests/integration/generated/format-matrix-exotic.test.ts index 9f63a556..879affb7 100644 --- a/tests/integration/format-matrix-exotic.test.ts +++ b/tests/integration/generated/format-matrix-exotic.test.ts @@ -20,8 +20,13 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Format definitions diff --git a/tests/integration/format-matrix-expanded.test.ts b/tests/integration/generated/format-matrix-expanded.test.ts similarity index 99% rename from tests/integration/format-matrix-expanded.test.ts rename to tests/integration/generated/format-matrix-expanded.test.ts index 0722cc60..3060b095 100644 --- a/tests/integration/format-matrix-expanded.test.ts +++ b/tests/integration/generated/format-matrix-expanded.test.ts @@ -34,8 +34,13 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Format sample definitions (subset relevant to the expanded tools) diff --git a/tests/integration/format-matrix-generated.test.ts b/tests/integration/generated/format-matrix-generated.test.ts similarity index 93% rename from tests/integration/format-matrix-generated.test.ts rename to tests/integration/generated/format-matrix-generated.test.ts index cc3eb2ec..9d2e66a4 100644 --- a/tests/integration/format-matrix-generated.test.ts +++ b/tests/integration/generated/format-matrix-generated.test.ts @@ -3,10 +3,18 @@ import { join } from "node:path"; import { TOOLS } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { getRegisteredToolIds, getToolConfig } from "../../apps/api/src/routes/tool-factory.js"; -import { fixtureDir } from "../fixtures/index.js"; -import { defaultSettingsFor, TOOL_SETTINGS_OVERRIDES } from "../helpers/tool-default-settings.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { getRegisteredToolIds, getToolConfig } from "../../../apps/api/src/routes/tool-factory.js"; +import { fixtureDir } from "../../fixtures/index.js"; +import { + defaultSettingsFor, + TOOL_SETTINGS_OVERRIDES, +} from "../../helpers/tool-default-settings.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; /** * Registry-generated tool x format matrix. diff --git a/tests/integration/format-matrix-multimodal.test.ts b/tests/integration/generated/format-matrix-multimodal.test.ts similarity index 97% rename from tests/integration/format-matrix-multimodal.test.ts rename to tests/integration/generated/format-matrix-multimodal.test.ts index 1a9657be..b35aba62 100644 --- a/tests/integration/format-matrix-multimodal.test.ts +++ b/tests/integration/generated/format-matrix-multimodal.test.ts @@ -2,9 +2,14 @@ import { existsSync, readdirSync, readFileSync } from "node:fs"; import { extname, join } from "node:path"; import { TOOL_BUNDLE_MAP, TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir } from "../fixtures/index.js"; -import { defaultSettingsFor } from "../helpers/tool-default-settings.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir } from "../../fixtures/index.js"; +import { defaultSettingsFor } from "../../helpers/tool-default-settings.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; /** * Multi-modality tool x format matrix. diff --git a/tests/integration/format-matrix.test.ts b/tests/integration/generated/format-matrix.test.ts similarity index 99% rename from tests/integration/format-matrix.test.ts rename to tests/integration/generated/format-matrix.test.ts index 6fb32906..ebcbc703 100644 --- a/tests/integration/format-matrix.test.ts +++ b/tests/integration/generated/format-matrix.test.ts @@ -19,8 +19,13 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Format sample definitions diff --git a/tests/integration/fuzz-settings.test.ts b/tests/integration/generated/fuzz-settings.test.ts similarity index 92% rename from tests/integration/fuzz-settings.test.ts rename to tests/integration/generated/fuzz-settings.test.ts index abda817c..d1acf7dd 100644 --- a/tests/integration/fuzz-settings.test.ts +++ b/tests/integration/generated/fuzz-settings.test.ts @@ -3,10 +3,10 @@ import fc from "fast-check"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import type { z } from "zod"; import { ZodFastCheck } from "zod-fast-check"; -import { getToolConfig } from "../../apps/api/src/routes/tool-factory.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { collectRegexStringSchemas } from "../helpers/zod-pict.js"; -import { buildTestApp, type TestApp } from "./test-server.js"; +import { getToolConfig } from "../../../apps/api/src/routes/tool-factory.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { collectRegexStringSchemas } from "../../helpers/zod-pict.js"; +import { buildTestApp, type TestApp } from "../test-server.js"; /** * Property-based settings fuzz: random VALID settings (derived from each diff --git a/tests/integration/new-formats.test.ts b/tests/integration/generated/new-formats.test.ts similarity index 98% rename from tests/integration/new-formats.test.ts rename to tests/integration/generated/new-formats.test.ts index 6a5a36a7..6e7e83a5 100644 --- a/tests/integration/new-formats.test.ts +++ b/tests/integration/generated/new-formats.test.ts @@ -9,8 +9,13 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; function isAsyncFallback(res: { statusCode: number; body: string }): boolean { if (res.statusCode !== 202) return false; diff --git a/tests/integration/settings-matrix.test.ts b/tests/integration/generated/settings-matrix.test.ts similarity index 99% rename from tests/integration/settings-matrix.test.ts rename to tests/integration/generated/settings-matrix.test.ts index c1f44dc9..c8350fa8 100644 --- a/tests/integration/settings-matrix.test.ts +++ b/tests/integration/generated/settings-matrix.test.ts @@ -1,6 +1,11 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures -- one canonical file per modality diff --git a/tests/integration/settings-pairwise.test.ts b/tests/integration/generated/settings-pairwise.test.ts similarity index 89% rename from tests/integration/settings-pairwise.test.ts rename to tests/integration/generated/settings-pairwise.test.ts index 37838483..56a80d0c 100644 --- a/tests/integration/settings-pairwise.test.ts +++ b/tests/integration/generated/settings-pairwise.test.ts @@ -1,11 +1,11 @@ import { TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { getToolConfig } from "../../apps/api/src/routes/tool-factory.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { pairwise } from "../helpers/pairwise.js"; -import { defaultSettingsFor } from "../helpers/tool-default-settings.js"; -import { compactCase, deriveAxes } from "../helpers/zod-pict.js"; -import { buildTestApp, type TestApp } from "./test-server.js"; +import { getToolConfig } from "../../../apps/api/src/routes/tool-factory.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { pairwise } from "../../helpers/pairwise.js"; +import { defaultSettingsFor } from "../../helpers/tool-default-settings.js"; +import { compactCase, deriveAxes } from "../../helpers/zod-pict.js"; +import { buildTestApp, type TestApp } from "../test-server.js"; /** * Pairwise settings matrix: a covering array over each tool's settings schema diff --git a/tests/integration/settings-phase1.test.ts b/tests/integration/generated/settings-phase1.test.ts similarity index 99% rename from tests/integration/settings-phase1.test.ts rename to tests/integration/generated/settings-phase1.test.ts index 74cea35e..49632399 100644 --- a/tests/integration/settings-phase1.test.ts +++ b/tests/integration/generated/settings-phase1.test.ts @@ -7,7 +7,7 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/analytics.test.ts b/tests/integration/platform/analytics.test.ts similarity index 99% rename from tests/integration/analytics.test.ts rename to tests/integration/platform/analytics.test.ts index f9581e1d..9f516d7b 100644 --- a/tests/integration/analytics.test.ts +++ b/tests/integration/platform/analytics.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let token: string; diff --git a/tests/integration/anonymous-mode.test.ts b/tests/integration/platform/anonymous-mode.test.ts similarity index 96% rename from tests/integration/anonymous-mode.test.ts rename to tests/integration/platform/anonymous-mode.test.ts index f60201ee..5b6c55f8 100644 --- a/tests/integration/anonymous-mode.test.ts +++ b/tests/integration/platform/anonymous-mode.test.ts @@ -1,9 +1,9 @@ import { randomUUID } from "node:crypto"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { ensureAnonymousUser, hashPassword } from "../../apps/api/src/plugins/auth.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { ensureAnonymousUser, hashPassword } from "../../../apps/api/src/plugins/auth.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/api-key-edge-cases.test.ts b/tests/integration/platform/api-key-edge-cases.test.ts similarity index 98% rename from tests/integration/api-key-edge-cases.test.ts rename to tests/integration/platform/api-key-edge-cases.test.ts index 4ae24bf2..94136da3 100644 --- a/tests/integration/api-key-edge-cases.test.ts +++ b/tests/integration/platform/api-key-edge-cases.test.ts @@ -4,8 +4,8 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/api-key-scoping.test.ts b/tests/integration/platform/api-key-scoping.test.ts similarity index 97% rename from tests/integration/api-key-scoping.test.ts rename to tests/integration/platform/api-key-scoping.test.ts index 4a524d46..efe36e5e 100644 --- a/tests/integration/api-key-scoping.test.ts +++ b/tests/integration/platform/api-key-scoping.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/api.test.ts b/tests/integration/platform/api.test.ts similarity index 99% rename from tests/integration/api.test.ts rename to tests/integration/platform/api.test.ts index 59557473..d9d0065d 100644 --- a/tests/integration/api.test.ts +++ b/tests/integration/platform/api.test.ts @@ -8,8 +8,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/audit-export.test.ts b/tests/integration/platform/audit-export.test.ts similarity index 96% rename from tests/integration/audit-export.test.ts rename to tests/integration/platform/audit-export.test.ts index 09a0d261..381c695d 100644 --- a/tests/integration/audit-export.test.ts +++ b/tests/integration/platform/audit-export.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/audit-log-edge-cases.test.ts b/tests/integration/platform/audit-log-edge-cases.test.ts similarity index 98% rename from tests/integration/audit-log-edge-cases.test.ts rename to tests/integration/platform/audit-log-edge-cases.test.ts index 80f44ff9..2ba8aa98 100644 --- a/tests/integration/audit-log-edge-cases.test.ts +++ b/tests/integration/platform/audit-log-edge-cases.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/audit-log.test.ts b/tests/integration/platform/audit-log.test.ts similarity index 95% rename from tests/integration/audit-log.test.ts rename to tests/integration/platform/audit-log.test.ts index df8f8171..c8486171 100644 --- a/tests/integration/audit-log.test.ts +++ b/tests/integration/platform/audit-log.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/audit-tool-operations.test.ts b/tests/integration/platform/audit-tool-operations.test.ts similarity index 93% rename from tests/integration/audit-tool-operations.test.ts rename to tests/integration/platform/audit-tool-operations.test.ts index 277597ba..5c7676c0 100644 --- a/tests/integration/audit-tool-operations.test.ts +++ b/tests/integration/platform/audit-tool-operations.test.ts @@ -6,9 +6,14 @@ * is disabled (the default). */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; const PNG = readFixture(fixtures.image.edge.px1); diff --git a/tests/integration/auth-edge-cases.test.ts b/tests/integration/platform/auth-edge-cases.test.ts similarity index 99% rename from tests/integration/auth-edge-cases.test.ts rename to tests/integration/platform/auth-edge-cases.test.ts index 5d476c40..4263c15f 100644 --- a/tests/integration/auth-edge-cases.test.ts +++ b/tests/integration/platform/auth-edge-cases.test.ts @@ -5,8 +5,8 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/batch.test.ts b/tests/integration/platform/batch.test.ts similarity index 98% rename from tests/integration/batch.test.ts rename to tests/integration/platform/batch.test.ts index 9e0323a5..baf62ef6 100644 --- a/tests/integration/batch.test.ts +++ b/tests/integration/platform/batch.test.ts @@ -12,10 +12,15 @@ import { join } from "node:path"; import { ffmpegAvailable } from "@snapotter/media-engine"; import AdmZip from "adm-zip"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { sharedRedis } from "../../apps/api/src/jobs/connection.js"; -import { bullPrefix } from "../../apps/api/src/jobs/types.js"; -import { fixtureDir, fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { sharedRedis } from "../../../apps/api/src/jobs/connection.js"; +import { bullPrefix } from "../../../apps/api/src/jobs/types.js"; +import { fixtureDir, fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/cleanup.test.ts b/tests/integration/platform/cleanup.test.ts similarity index 92% rename from tests/integration/cleanup.test.ts rename to tests/integration/platform/cleanup.test.ts index 4e2814ed..60ea9cc6 100644 --- a/tests/integration/cleanup.test.ts +++ b/tests/integration/platform/cleanup.test.ts @@ -1,8 +1,8 @@ import { eq } from "drizzle-orm"; import { afterEach, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { runMigrations } from "../../apps/api/src/db/migrate.js"; -import { getMaxAgeMs, shouldRunStartupCleanup } from "../../apps/api/src/lib/cleanup.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { runMigrations } from "../../../apps/api/src/db/migrate.js"; +import { getMaxAgeMs, shouldRunStartupCleanup } from "../../../apps/api/src/lib/cleanup.js"; beforeAll(async () => { await runMigrations(); diff --git a/tests/integration/concurrent.test.ts b/tests/integration/platform/concurrent.test.ts similarity index 99% rename from tests/integration/concurrent.test.ts rename to tests/integration/platform/concurrent.test.ts index e957fb26..d1df5f86 100644 --- a/tests/integration/concurrent.test.ts +++ b/tests/integration/platform/concurrent.test.ts @@ -6,8 +6,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/config-export-import.test.ts b/tests/integration/platform/config-export-import.test.ts similarity index 94% rename from tests/integration/config-export-import.test.ts rename to tests/integration/platform/config-export-import.test.ts index 1dd717f0..74cd05ed 100644 --- a/tests/integration/config-export-import.test.ts +++ b/tests/integration/platform/config-export-import.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; @@ -71,9 +71,9 @@ describe("config export with enterprise license", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["config_export_import"]); - const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); + const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); licensedApp = await buildTestApp(); licensedToken = await loginAsAdmin(licensedApp.app); }, 30_000); @@ -154,9 +154,9 @@ describe("config import with enterprise license", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["config_export_import"]); - const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); + const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); licensedApp = await buildTestApp(); licensedToken = await loginAsAdmin(licensedApp.app); }, 30_000); @@ -294,9 +294,9 @@ describe("config round-trip", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["config_export_import"]); - const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); + const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); licensedApp = await buildTestApp(); licensedToken = await loginAsAdmin(licensedApp.app); }, 30_000); diff --git a/tests/integration/cross-modality-smoke.test.ts b/tests/integration/platform/cross-modality-smoke.test.ts similarity index 97% rename from tests/integration/cross-modality-smoke.test.ts rename to tests/integration/platform/cross-modality-smoke.test.ts index 3c0dc012..b98b74bf 100644 --- a/tests/integration/cross-modality-smoke.test.ts +++ b/tests/integration/platform/cross-modality-smoke.test.ts @@ -16,8 +16,13 @@ import { spawnSync } from "node:child_process"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // ── Binary gates ────────────────────────────────────────────────────── function hasBinary(name: string): boolean { diff --git a/tests/integration/custom-roles-edge-cases.test.ts b/tests/integration/platform/custom-roles-edge-cases.test.ts similarity index 98% rename from tests/integration/custom-roles-edge-cases.test.ts rename to tests/integration/platform/custom-roles-edge-cases.test.ts index 04bb95f5..7e02f08c 100644 --- a/tests/integration/custom-roles-edge-cases.test.ts +++ b/tests/integration/platform/custom-roles-edge-cases.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/custom-roles.test.ts b/tests/integration/platform/custom-roles.test.ts similarity index 97% rename from tests/integration/custom-roles.test.ts rename to tests/integration/platform/custom-roles.test.ts index 5fc335c7..c12a2ea9 100644 --- a/tests/integration/custom-roles.test.ts +++ b/tests/integration/platform/custom-roles.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/doc-engine-pdf-ops.test.ts b/tests/integration/platform/doc-engine-pdf-ops.test.ts similarity index 99% rename from tests/integration/doc-engine-pdf-ops.test.ts rename to tests/integration/platform/doc-engine-pdf-ops.test.ts index e7e61eb4..97a4ad48 100644 --- a/tests/integration/doc-engine-pdf-ops.test.ts +++ b/tests/integration/platform/doc-engine-pdf-ops.test.ts @@ -20,7 +20,7 @@ import { qpdfSplitRanges, } from "@snapotter/doc-engine"; import { describe, expect, it } from "vitest"; -import { fixtures } from "../fixtures/index.js"; +import { fixtures } from "../../fixtures/index.js"; const PDF = fixtures.document.pdf3; diff --git a/tests/integration/doc-engine-pdfcpu.test.ts b/tests/integration/platform/doc-engine-pdfcpu.test.ts similarity index 99% rename from tests/integration/doc-engine-pdfcpu.test.ts rename to tests/integration/platform/doc-engine-pdfcpu.test.ts index e8f4a6c7..7fe989dc 100644 --- a/tests/integration/doc-engine-pdfcpu.test.ts +++ b/tests/integration/platform/doc-engine-pdfcpu.test.ts @@ -10,7 +10,7 @@ import { pdfcpuTextStamp, } from "@snapotter/doc-engine"; import { describe, expect, it } from "vitest"; -import { fixtures } from "../fixtures/index.js"; +import { fixtures } from "../../fixtures/index.js"; const PDF = fixtures.document.pdf3; diff --git a/tests/integration/doc-engine.test.ts b/tests/integration/platform/doc-engine.test.ts similarity index 96% rename from tests/integration/doc-engine.test.ts rename to tests/integration/platform/doc-engine.test.ts index 15f01b72..022ad53b 100644 --- a/tests/integration/doc-engine.test.ts +++ b/tests/integration/platform/doc-engine.test.ts @@ -10,7 +10,7 @@ import { sofficeAvailable, } from "@snapotter/doc-engine"; import { describe, expect, it } from "vitest"; -import { fixtures } from "../fixtures/index.js"; +import { fixtures } from "../../fixtures/index.js"; const PDF = fixtures.document.pdf3; const DOCX = fixtures.document.tiny("docx"); diff --git a/tests/integration/docs-dispatcher.test.ts b/tests/integration/platform/docs-dispatcher.test.ts similarity index 95% rename from tests/integration/docs-dispatcher.test.ts rename to tests/integration/platform/docs-dispatcher.test.ts index 6546575c..8d0bb316 100644 --- a/tests/integration/docs-dispatcher.test.ts +++ b/tests/integration/platform/docs-dispatcher.test.ts @@ -10,8 +10,8 @@ import { pdfTextPy, } from "@snapotter/doc-engine"; import { afterAll, describe, expect, it } from "vitest"; -import { fixtures } from "../fixtures/index.js"; -import { hasFitz, hasPikepdf, hasPython } from "../helpers/python-gate.js"; +import { fixtures } from "../../fixtures/index.js"; +import { hasFitz, hasPikepdf, hasPython } from "../../helpers/python-gate.js"; // Ensure the bridge uses a reachable Python; set PYTHON_VENV_PATH before // any import triggers a dispatcher spawn. diff --git a/tests/integration/docs.test.ts b/tests/integration/platform/docs.test.ts similarity index 96% rename from tests/integration/docs.test.ts rename to tests/integration/platform/docs.test.ts index b9a17d87..d625aa3b 100644 --- a/tests/integration/docs.test.ts +++ b/tests/integration/platform/docs.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, type TestApp } from "./test-server"; +import { buildTestApp, type TestApp } from "../test-server"; describe("API docs", () => { let testApp: TestApp; diff --git a/tests/integration/download-range.test.ts b/tests/integration/platform/download-range.test.ts similarity index 96% rename from tests/integration/download-range.test.ts rename to tests/integration/platform/download-range.test.ts index f766fcc8..1cd5bdda 100644 --- a/tests/integration/download-range.test.ts +++ b/tests/integration/platform/download-range.test.ts @@ -1,6 +1,6 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { deletePrefix, putObject } from "../../apps/api/src/lib/object-storage.js"; -import { buildTestApp, type TestApp } from "./test-server.js"; +import { deletePrefix, putObject } from "../../../apps/api/src/lib/object-storage.js"; +import { buildTestApp, type TestApp } from "../test-server.js"; describe("download endpoint (object storage + Range)", () => { let testApp: TestApp; diff --git a/tests/integration/edge-cases.test.ts b/tests/integration/platform/edge-cases.test.ts similarity index 99% rename from tests/integration/edge-cases.test.ts rename to tests/integration/platform/edge-cases.test.ts index 1ed5d996..385e55e3 100644 --- a/tests/integration/edge-cases.test.ts +++ b/tests/integration/platform/edge-cases.test.ts @@ -6,8 +6,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/escalation.test.ts b/tests/integration/platform/escalation.test.ts similarity index 98% rename from tests/integration/escalation.test.ts rename to tests/integration/platform/escalation.test.ts index a79ecec6..166e5db2 100644 --- a/tests/integration/escalation.test.ts +++ b/tests/integration/platform/escalation.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/factory-multi-input.test.ts b/tests/integration/platform/factory-multi-input.test.ts similarity index 97% rename from tests/integration/factory-multi-input.test.ts rename to tests/integration/platform/factory-multi-input.test.ts index 363bb7c2..c29629c6 100644 --- a/tests/integration/factory-multi-input.test.ts +++ b/tests/integration/platform/factory-multi-input.test.ts @@ -8,16 +8,16 @@ import { TOOLS } from "@snapotter/shared"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { createToolRoute } from "../../apps/api/src/routes/tool-factory.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { createToolRoute } from "../../../apps/api/src/routes/tool-factory.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; import { buildTestApp, createMultipartPayload, loginAsAdmin, preReadyHooks, type TestApp, -} from "./test-server.js"; +} from "../test-server.js"; const PNG = readFixture(fixtures.image.edge.px1); const PNG_A = readFixture(fixtures.image.edge.px1); diff --git a/tests/integration/feature-import.test.ts b/tests/integration/platform/feature-import.test.ts similarity index 98% rename from tests/integration/feature-import.test.ts rename to tests/integration/platform/feature-import.test.ts index 71c25116..8004d093 100644 --- a/tests/integration/feature-import.test.ts +++ b/tests/integration/platform/feature-import.test.ts @@ -47,10 +47,10 @@ const { invalidateCache, ImportLockError, ImportValidationError, -} = await import("../../apps/api/src/lib/feature-status.js"); +} = await import("../../../apps/api/src/lib/feature-status.js"); // Test helpers from test-server -const { createMultipartPayload, loginAsAdmin } = await import("./test-server.js"); +const { createMultipartPayload, loginAsAdmin } = await import("../test-server.js"); // Use face-detection as smallest bundle from the manifest const testBundleId = "face-detection"; @@ -347,7 +347,7 @@ describe("POST /api/v1/admin/features/import", () => { await app.register(cookie, { secret: "test-cookie-secret", hook: "onRequest" }); const { authMiddleware, authRoutes, ensureBuiltinRoles, ensureDefaultAdmin } = await import( - "../../apps/api/src/plugins/auth.js" + "../../../apps/api/src/plugins/auth.js" ); await authMiddleware(app); await authRoutes(app); @@ -355,14 +355,14 @@ describe("POST /api/v1/admin/features/import", () => { await ensureDefaultAdmin(); // Clear mustChangePassword for admin - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); await db .update(schema.users) .set({ mustChangePassword: false }) .where(eq(schema.users.username, "admin")); - const { registerFeatureRoutes } = await import("../../apps/api/src/routes/features.js"); + const { registerFeatureRoutes } = await import("../../../apps/api/src/routes/features.js"); await registerFeatureRoutes(app); token = await loginAsAdmin(app); diff --git a/tests/integration/fetch-urls.test.ts b/tests/integration/platform/fetch-urls.test.ts similarity index 98% rename from tests/integration/fetch-urls.test.ts rename to tests/integration/platform/fetch-urls.test.ts index 3bb86f7d..6eec3ef6 100644 --- a/tests/integration/fetch-urls.test.ts +++ b/tests/integration/platform/fetch-urls.test.ts @@ -8,8 +8,8 @@ */ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; const JPG = readFixture(fixtures.image.base.jpg100); const TIFF = readFixture(fixtures.image.formats("tiff")); diff --git a/tests/integration/gdpr-lifecycle.test.ts b/tests/integration/platform/gdpr-lifecycle.test.ts similarity index 98% rename from tests/integration/gdpr-lifecycle.test.ts rename to tests/integration/platform/gdpr-lifecycle.test.ts index 840b29c6..89c11c8d 100644 --- a/tests/integration/gdpr-lifecycle.test.ts +++ b/tests/integration/platform/gdpr-lifecycle.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/ip-allowlist-routes.test.ts b/tests/integration/platform/ip-allowlist-routes.test.ts similarity index 95% rename from tests/integration/ip-allowlist-routes.test.ts rename to tests/integration/platform/ip-allowlist-routes.test.ts index 7f57b968..dba96e80 100644 --- a/tests/integration/ip-allowlist-routes.test.ts +++ b/tests/integration/platform/ip-allowlist-routes.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; @@ -64,9 +64,9 @@ describe("IP allowlist with enterprise license", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["ip_allowlist"]); - const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); + const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); enterpriseApp = await buildTestApp(); entAdminToken = await loginAsAdmin(enterpriseApp.app); diff --git a/tests/integration/job-spine.test.ts b/tests/integration/platform/job-spine.test.ts similarity index 90% rename from tests/integration/job-spine.test.ts rename to tests/integration/platform/job-spine.test.ts index 4a217a63..7b8c5dd6 100644 --- a/tests/integration/job-spine.test.ts +++ b/tests/integration/platform/job-spine.test.ts @@ -7,17 +7,17 @@ import { randomUUID } from "node:crypto"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { requestCancel } from "../../apps/api/src/jobs/cancel.js"; -import { sharedRedis } from "../../apps/api/src/jobs/connection.js"; -import { enqueueToolJob, waitForJob } from "../../apps/api/src/jobs/enqueue.js"; -import { bullPrefix, type ToolJobData } from "../../apps/api/src/jobs/types.js"; -import { putObject } from "../../apps/api/src/lib/object-storage.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { requestCancel } from "../../../apps/api/src/jobs/cancel.js"; +import { sharedRedis } from "../../../apps/api/src/jobs/connection.js"; +import { enqueueToolJob, waitForJob } from "../../../apps/api/src/jobs/enqueue.js"; +import { bullPrefix, type ToolJobData } from "../../../apps/api/src/jobs/types.js"; +import { putObject } from "../../../apps/api/src/lib/object-storage.js"; import { registerToolProcessFn, type ToolProcessCtx, -} from "../../apps/api/src/routes/tool-factory.js"; -import { buildTestApp, type TestApp } from "./test-server.js"; +} from "../../../apps/api/src/routes/tool-factory.js"; +import { buildTestApp, type TestApp } from "../test-server.js"; // Register test-only tools for the spine tests registerToolProcessFn({ diff --git a/tests/integration/jobs-schema.test.ts b/tests/integration/platform/jobs-schema.test.ts similarity index 95% rename from tests/integration/jobs-schema.test.ts rename to tests/integration/platform/jobs-schema.test.ts index 5099c5ae..b4a6f41c 100644 --- a/tests/integration/jobs-schema.test.ts +++ b/tests/integration/platform/jobs-schema.test.ts @@ -1,6 +1,6 @@ import { sql } from "drizzle-orm"; import { describe, expect, it } from "vitest"; -import { db } from "../../apps/api/src/db/index.js"; +import { db } from "../../../apps/api/src/db/index.js"; describe("jobs table (phase 2 spine)", () => { it("has the spine columns and canceled status", async () => { diff --git a/tests/integration/legal-hold.test.ts b/tests/integration/platform/legal-hold.test.ts similarity index 97% rename from tests/integration/legal-hold.test.ts rename to tests/integration/platform/legal-hold.test.ts index 6ca5c821..2a579f56 100644 --- a/tests/integration/legal-hold.test.ts +++ b/tests/integration/platform/legal-hold.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/media-engine.test.ts b/tests/integration/platform/media-engine.test.ts similarity index 97% rename from tests/integration/media-engine.test.ts rename to tests/integration/platform/media-engine.test.ts index 3120e6e0..38beebb1 100644 --- a/tests/integration/media-engine.test.ts +++ b/tests/integration/platform/media-engine.test.ts @@ -3,7 +3,7 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia, runFfmpeg } from "@snapotter/media-engine"; import { describe, expect, it } from "vitest"; -import { fixtures } from "../fixtures/index.js"; +import { fixtures } from "../../fixtures/index.js"; const FIXTURE = fixtures.video.tiny("mp4"); diff --git a/tests/integration/mfa-endpoints.test.ts b/tests/integration/platform/mfa-endpoints.test.ts similarity index 96% rename from tests/integration/mfa-endpoints.test.ts rename to tests/integration/platform/mfa-endpoints.test.ts index 8a4896ef..f74bbc69 100644 --- a/tests/integration/mfa-endpoints.test.ts +++ b/tests/integration/platform/mfa-endpoints.test.ts @@ -3,13 +3,13 @@ import * as OTPAuth from "otpauth"; import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest"; vi.resetModules(); -const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); +const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["mfa"]); -const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); -const { db, schema } = await import("../../apps/api/src/db/index.js"); +const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); +const { db, schema } = await import("../../../apps/api/src/db/index.js"); -import type { TestApp } from "./test-server.js"; +import type { TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/migrate-from-sqlite.test.ts b/tests/integration/platform/migrate-from-sqlite.test.ts similarity index 99% rename from tests/integration/migrate-from-sqlite.test.ts rename to tests/integration/platform/migrate-from-sqlite.test.ts index 5e8dde4f..b37571d1 100644 --- a/tests/integration/migrate-from-sqlite.test.ts +++ b/tests/integration/platform/migrate-from-sqlite.test.ts @@ -4,8 +4,8 @@ import { join } from "node:path"; import Database from "better-sqlite3"; import { sql } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db } from "../../apps/api/src/db/index.js"; -import { migrateFromSqlite } from "../../apps/api/src/db/migrate-from-sqlite.js"; +import { db } from "../../../apps/api/src/db/index.js"; +import { migrateFromSqlite } from "../../../apps/api/src/db/migrate-from-sqlite.js"; function buildFixtureSqlite(path: string): void { const s = new Database(path); diff --git a/tests/integration/modality-input.test.ts b/tests/integration/platform/modality-input.test.ts similarity index 90% rename from tests/integration/modality-input.test.ts rename to tests/integration/platform/modality-input.test.ts index f68742ad..155d0a65 100644 --- a/tests/integration/modality-input.test.ts +++ b/tests/integration/platform/modality-input.test.ts @@ -5,10 +5,10 @@ import { join } from "node:path"; import { qpdfAvailable } from "@snapotter/doc-engine"; import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, describe, expect, it } from "vitest"; -import { InputValidationError } from "../../apps/api/src/modality/contract.js"; -import { DocumentInputHandler } from "../../apps/api/src/modality/document-input.js"; -import { MediaInputHandler } from "../../apps/api/src/modality/media-input.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; +import { InputValidationError } from "../../../apps/api/src/modality/contract.js"; +import { DocumentInputHandler } from "../../../apps/api/src/modality/document-input.js"; +import { MediaInputHandler } from "../../../apps/api/src/modality/media-input.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; const scratchDir = mkdtempSync(join(tmpdir(), "modality-input-")); afterAll(() => rmSync(scratchDir, { recursive: true, force: true })); @@ -41,7 +41,7 @@ describe.skipIf(!ffmpegAvailable())("MediaInputHandler (requires ffmpeg)", () => }); it("enforces the duration cap", async () => { - const { env } = await import("../../apps/api/src/config.js"); + const { env } = await import("../../../apps/api/src/config.js"); const original = env.MAX_AUDIO_DURATION_S; (env as Record).MAX_AUDIO_DURATION_S = 0.5; try { @@ -66,7 +66,7 @@ describe("DocumentInputHandler", () => { const buf = readFixture(fixtures.document.pdf3); const out = await new DocumentInputHandler().prepare(buf, "test.pdf", { scratchDir }); expect(out.buffer).toBe(buf); - const { env } = await import("../../apps/api/src/config.js"); + const { env } = await import("../../../apps/api/src/config.js"); const original = env.MAX_PDF_PAGES; (env as Record).MAX_PDF_PAGES = 2; try { diff --git a/tests/integration/modality-media-kinds.test.ts b/tests/integration/platform/modality-media-kinds.test.ts similarity index 91% rename from tests/integration/modality-media-kinds.test.ts rename to tests/integration/platform/modality-media-kinds.test.ts index e0ee1753..ddf3b361 100644 --- a/tests/integration/modality-media-kinds.test.ts +++ b/tests/integration/platform/modality-media-kinds.test.ts @@ -3,8 +3,8 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable } from "@snapotter/media-engine"; import { describe, expect, it } from "vitest"; -import { MediaInputHandler } from "../../apps/api/src/modality/media-input.js"; -import { fixtureRoot } from "../fixtures/index.js"; +import { MediaInputHandler } from "../../../apps/api/src/modality/media-input.js"; +import { fixtureRoot } from "../../fixtures/index.js"; const FIX = fixtureRoot; const MP4 = readFileSync(join(FIX, "media", "tiny.mp4")); diff --git a/tests/integration/observability.test.ts b/tests/integration/platform/observability.test.ts similarity index 97% rename from tests/integration/observability.test.ts rename to tests/integration/platform/observability.test.ts index ed1ffa53..f1b8edac 100644 --- a/tests/integration/observability.test.ts +++ b/tests/integration/platform/observability.test.ts @@ -4,7 +4,7 @@ * - GET/POST /api/v1/admin/log-level (runtime log level) */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/oidc-auth.test.ts b/tests/integration/platform/oidc-auth.test.ts similarity index 99% rename from tests/integration/oidc-auth.test.ts rename to tests/integration/platform/oidc-auth.test.ts index 50f4af6b..d75d4b30 100644 --- a/tests/integration/oidc-auth.test.ts +++ b/tests/integration/platform/oidc-auth.test.ts @@ -13,9 +13,9 @@ import { randomUUID } from "node:crypto"; import { createServer, type Server } from "node:http"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { env } from "../../apps/api/src/config.js"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { env } from "../../../apps/api/src/config.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; // ── Helpers ────────────────────────────────────────────────────────── @@ -440,7 +440,7 @@ describe("OIDC login redirect", () => { (env as any).OIDC_CLIENT_SECRET = "test-client-secret"; // Clear the cached OIDC config so discovery hits our mock - const _oidcModule = await import("../../apps/api/src/plugins/oidc.js"); + const _oidcModule = await import("../../../apps/api/src/plugins/oidc.js"); // The module caches config in a module-level variable; rebuild app to get fresh routes oidcApp = await buildTestApp(); }, 30_000); diff --git a/tests/integration/ownership-enforcement.test.ts b/tests/integration/platform/ownership-enforcement.test.ts similarity index 97% rename from tests/integration/ownership-enforcement.test.ts rename to tests/integration/platform/ownership-enforcement.test.ts index e5d3caf8..8afb1854 100644 --- a/tests/integration/ownership-enforcement.test.ts +++ b/tests/integration/platform/ownership-enforcement.test.ts @@ -9,8 +9,13 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; let testApp: TestApp; let adminToken: string; @@ -30,7 +35,9 @@ let userAFileId: string; let userAPipelineId: string; // Load test fixture -const fixtureBuffer = readFileSync(join(import.meta.dirname, "..", "fixtures", "test-1x1.png")); +const fixtureBuffer = readFileSync( + join(import.meta.dirname, "..", "..", "fixtures", "test-1x1.png"), +); /** Register a user, clear mustChangePassword, log in, return token. */ async function createAndLogin( diff --git a/tests/integration/permissions.test.ts b/tests/integration/platform/permissions.test.ts similarity index 98% rename from tests/integration/permissions.test.ts rename to tests/integration/platform/permissions.test.ts index 1c7d9d65..50dfd5f1 100644 --- a/tests/integration/permissions.test.ts +++ b/tests/integration/platform/permissions.test.ts @@ -2,8 +2,13 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; let testApp: TestApp; let adminToken: string; @@ -249,7 +254,7 @@ describe("permission enforcement on routes", () => { }); describe("tool and pipeline permission enforcement", () => { - const fixturePath = join(import.meta.dirname, "..", "fixtures", "test-200x150.png"); + const fixturePath = join(import.meta.dirname, "..", "..", "fixtures", "test-200x150.png"); const fixtureBuffer = readFileSync(fixturePath); it("unauthenticated user cannot use tools", async () => { @@ -443,7 +448,9 @@ describe("file ownership scoping", () => { it("user A cannot access user B's file by ID", async () => { // Upload as user A - const testImage = readFileSync(join(import.meta.dirname, "..", "fixtures", "test-200x150.png")); + const testImage = readFileSync( + join(import.meta.dirname, "..", "..", "fixtures", "test-200x150.png"), + ); const { body: uploadBody, contentType } = createMultipartPayload([ { name: "file", filename: "test.png", contentType: "image/png", content: testImage }, ]); diff --git a/tests/integration/pipeline-edge-cases.test.ts b/tests/integration/platform/pipeline-edge-cases.test.ts similarity index 99% rename from tests/integration/pipeline-edge-cases.test.ts rename to tests/integration/platform/pipeline-edge-cases.test.ts index 88687810..a2bfbc62 100644 --- a/tests/integration/pipeline-edge-cases.test.ts +++ b/tests/integration/platform/pipeline-edge-cases.test.ts @@ -7,8 +7,13 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/pool-routing.test.ts b/tests/integration/platform/pool-routing.test.ts similarity index 87% rename from tests/integration/pool-routing.test.ts rename to tests/integration/platform/pool-routing.test.ts index a1e1f7d9..b11bc098 100644 --- a/tests/integration/pool-routing.test.ts +++ b/tests/integration/platform/pool-routing.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { resolveToolPool, shouldSkipSyncWindow } from "../../apps/api/src/lib/pool.js"; +import { resolveToolPool, shouldSkipSyncWindow } from "../../../apps/api/src/lib/pool.js"; describe("pool routing", () => { it("image tools stay on the image pool", () => { diff --git a/tests/integration/preview-modality.test.ts b/tests/integration/platform/preview-modality.test.ts similarity index 83% rename from tests/integration/preview-modality.test.ts rename to tests/integration/platform/preview-modality.test.ts index f462fda9..38821b5b 100644 --- a/tests/integration/preview-modality.test.ts +++ b/tests/integration/platform/preview-modality.test.ts @@ -2,8 +2,8 @@ import { readFile } from "node:fs/promises"; import { resolveGs } from "@snapotter/doc-engine"; import { ffmpegAvailable } from "@snapotter/media-engine"; import { describe, expect, it } from "vitest"; -import { pdfFirstPagePreview, videoPosterPreview } from "../../apps/api/src/modality/preview.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; +import { pdfFirstPagePreview, videoPosterPreview } from "../../../apps/api/src/modality/preview.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; describe.skipIf(!ffmpegAvailable())("video poster preview (requires ffmpeg)", () => { it("renders a webp poster", async () => { diff --git a/tests/integration/process-contract.test.ts b/tests/integration/platform/process-contract.test.ts similarity index 93% rename from tests/integration/process-contract.test.ts rename to tests/integration/platform/process-contract.test.ts index 93aa7c23..8b2fe06e 100644 --- a/tests/integration/process-contract.test.ts +++ b/tests/integration/platform/process-contract.test.ts @@ -11,12 +11,12 @@ import { writeFile } from "node:fs/promises"; import { join } from "node:path"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { enqueueToolJob, waitForJob } from "../../apps/api/src/jobs/enqueue.js"; -import type { ToolJobData } from "../../apps/api/src/jobs/types.js"; -import { getObjectBuffer, putObject } from "../../apps/api/src/lib/object-storage.js"; -import { registerToolProcessFn } from "../../apps/api/src/routes/tool-factory.js"; -import { buildTestApp, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { enqueueToolJob, waitForJob } from "../../../apps/api/src/jobs/enqueue.js"; +import type { ToolJobData } from "../../../apps/api/src/jobs/types.js"; +import { getObjectBuffer, putObject } from "../../../apps/api/src/lib/object-storage.js"; +import { registerToolProcessFn } from "../../../apps/api/src/routes/tool-factory.js"; +import { buildTestApp, type TestApp } from "../test-server.js"; // Register a native-v2 test tool that concatenates two inputs via scratchPath registerToolProcessFn({ diff --git a/tests/integration/progress-transport.test.ts b/tests/integration/platform/progress-transport.test.ts similarity index 94% rename from tests/integration/progress-transport.test.ts rename to tests/integration/platform/progress-transport.test.ts index fb50bafd..d6abf74c 100644 --- a/tests/integration/progress-transport.test.ts +++ b/tests/integration/platform/progress-transport.test.ts @@ -14,9 +14,9 @@ import { randomUUID } from "node:crypto"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { updateSingleFileProgress } from "../../apps/api/src/routes/progress.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { updateSingleFileProgress } from "../../../apps/api/src/routes/progress.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; @@ -95,7 +95,7 @@ describe("Redis progress transport", () => { const jobId = `tp-batch-${randomUUID()}`; // Use the updateJobProgress export (imported indirectly via the module) - const { updateJobProgress } = await import("../../apps/api/src/routes/progress.js"); + const { updateJobProgress } = await import("../../../apps/api/src/routes/progress.js"); updateJobProgress({ jobId, status: "completed", diff --git a/tests/integration/progress.test.ts b/tests/integration/platform/progress.test.ts similarity index 98% rename from tests/integration/progress.test.ts rename to tests/integration/platform/progress.test.ts index 9c39acaf..80173e48 100644 --- a/tests/integration/progress.test.ts +++ b/tests/integration/platform/progress.test.ts @@ -17,10 +17,18 @@ import { randomUUID } from "node:crypto"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { updateJobProgress, updateSingleFileProgress } from "../../apps/api/src/routes/progress.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { + updateJobProgress, + updateSingleFileProgress, +} from "../../../apps/api/src/routes/progress.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/rbac-matrix-full.test.ts b/tests/integration/platform/rbac-matrix-full.test.ts similarity index 98% rename from tests/integration/rbac-matrix-full.test.ts rename to tests/integration/platform/rbac-matrix-full.test.ts index 3fdf7556..c4911c91 100644 --- a/tests/integration/rbac-matrix-full.test.ts +++ b/tests/integration/platform/rbac-matrix-full.test.ts @@ -7,8 +7,8 @@ */ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/rbac-matrix.test.ts b/tests/integration/platform/rbac-matrix.test.ts similarity index 96% rename from tests/integration/rbac-matrix.test.ts rename to tests/integration/platform/rbac-matrix.test.ts index bc4da89d..52ba0260 100644 --- a/tests/integration/rbac-matrix.test.ts +++ b/tests/integration/platform/rbac-matrix.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/s3-storage.test.ts b/tests/integration/platform/s3-storage.test.ts similarity index 87% rename from tests/integration/s3-storage.test.ts rename to tests/integration/platform/s3-storage.test.ts index bf9533fb..ea41cd30 100644 --- a/tests/integration/s3-storage.test.ts +++ b/tests/integration/platform/s3-storage.test.ts @@ -19,8 +19,8 @@ import { } from "@aws-sdk/client-s3"; import { loadS3Storage, type S3StorageModule } from "@snapotter/enterprise"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { env } from "../../apps/api/src/config.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; +import { env } from "../../../apps/api/src/config.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; const PNG = readFixture(fixtures.image.base.png200); @@ -108,7 +108,7 @@ describe.skipIf(!minioAvailable)("S3 storage backend", () => { }, 15_000); it("saveFile writes object to S3", async () => { - const { saveFile } = await import("../../apps/api/src/lib/file-storage.js"); + const { saveFile } = await import("../../../apps/api/src/lib/file-storage.js"); storedName = await saveFile(PNG, "test-upload.png"); expect(storedName).toMatch(/^[a-f0-9-]+\.png$/); @@ -116,13 +116,13 @@ describe.skipIf(!minioAvailable)("S3 storage backend", () => { }); it("readStoredFile returns the correct buffer", async () => { - const { readStoredFile } = await import("../../apps/api/src/lib/file-storage.js"); + const { readStoredFile } = await import("../../../apps/api/src/lib/file-storage.js"); const buffer = await readStoredFile(storedName); expect(Buffer.compare(buffer, PNG)).toBe(0); }); it("streamStoredFile returns a readable stream", async () => { - const { streamStoredFile } = await import("../../apps/api/src/lib/file-storage.js"); + const { streamStoredFile } = await import("../../../apps/api/src/lib/file-storage.js"); const stream = await streamStoredFile(storedName); const chunks: Buffer[] = []; @@ -134,7 +134,7 @@ describe.skipIf(!minioAvailable)("S3 storage backend", () => { it("saveThumbnail stores in S3, getCachedThumbnail retrieves it", async () => { const { saveThumbnail, getCachedThumbnail } = await import( - "../../apps/api/src/lib/file-storage.js" + "../../../apps/api/src/lib/file-storage.js" ); const thumbData = Buffer.from("fake-thumbnail-data"); @@ -147,29 +147,31 @@ describe.skipIf(!minioAvailable)("S3 storage backend", () => { }); it("deleteThumbnail removes thumbnail from S3", async () => { - const { deleteThumbnail } = await import("../../apps/api/src/lib/file-storage.js"); + const { deleteThumbnail } = await import("../../../apps/api/src/lib/file-storage.js"); await deleteThumbnail(storedName); expect(await objectExists(`thumbs/${storedName}.thumb.jpg`)).toBe(false); }); it("deleteStoredFile removes file from S3", async () => { - const { deleteStoredFile } = await import("../../apps/api/src/lib/file-storage.js"); + const { deleteStoredFile } = await import("../../../apps/api/src/lib/file-storage.js"); await deleteStoredFile(storedName); expect(await objectExists(`files/${storedName}`)).toBe(false); }); it("deleteStoredFile is idempotent (no error for missing key)", async () => { - const { deleteStoredFile } = await import("../../apps/api/src/lib/file-storage.js"); + const { deleteStoredFile } = await import("../../../apps/api/src/lib/file-storage.js"); await expect(deleteStoredFile("nonexistent-file.png")).resolves.toBeUndefined(); }); it("getCachedThumbnail returns null for missing thumbnail", async () => { - const { getCachedThumbnail } = await import("../../apps/api/src/lib/file-storage.js"); + const { getCachedThumbnail } = await import("../../../apps/api/src/lib/file-storage.js"); expect(await getCachedThumbnail("nonexistent.png")).toBeNull(); }); it("S3_PREFIX scopes all object keys under a tenant prefix", async () => { - const { saveFile, deleteStoredFile } = await import("../../apps/api/src/lib/file-storage.js"); + const { saveFile, deleteStoredFile } = await import( + "../../../apps/api/src/lib/file-storage.js" + ); (env as Record).S3_PREFIX = "tenant-123"; s3Storage.configureS3({ diff --git a/tests/integration/scim.test.ts b/tests/integration/platform/scim.test.ts similarity index 98% rename from tests/integration/scim.test.ts rename to tests/integration/platform/scim.test.ts index a04fb724..e7e3f591 100644 --- a/tests/integration/scim.test.ts +++ b/tests/integration/platform/scim.test.ts @@ -1,7 +1,7 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { hashPassword } from "../../apps/api/src/plugins/auth.js"; -import { buildTestApp, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { hashPassword } from "../../../apps/api/src/plugins/auth.js"; +import { buildTestApp, type TestApp } from "../test-server.js"; let testApp: TestApp; const SCIM_TOKEN = "test-scim-token-abc123"; diff --git a/tests/integration/siem-config.test.ts b/tests/integration/platform/siem-config.test.ts similarity index 96% rename from tests/integration/siem-config.test.ts rename to tests/integration/platform/siem-config.test.ts index 8364e509..71a6b959 100644 --- a/tests/integration/siem-config.test.ts +++ b/tests/integration/platform/siem-config.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; @@ -72,9 +72,9 @@ describe("SIEM config with enterprise license", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["siem_forwarding"]); - const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); + const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); enterpriseApp = await buildTestApp(); entAdminToken = await loginAsAdmin(enterpriseApp.app); diff --git a/tests/integration/siem-forwarding.test.ts b/tests/integration/platform/siem-forwarding.test.ts similarity index 94% rename from tests/integration/siem-forwarding.test.ts rename to tests/integration/platform/siem-forwarding.test.ts index de4df44b..1f380302 100644 --- a/tests/integration/siem-forwarding.test.ts +++ b/tests/integration/platform/siem-forwarding.test.ts @@ -1,5 +1,5 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/support-bundle.test.ts b/tests/integration/platform/support-bundle.test.ts similarity index 94% rename from tests/integration/support-bundle.test.ts rename to tests/integration/platform/support-bundle.test.ts index 400e0a37..0243de79 100644 --- a/tests/integration/support-bundle.test.ts +++ b/tests/integration/platform/support-bundle.test.ts @@ -7,9 +7,9 @@ import { randomUUID } from "node:crypto"; import AdmZip from "adm-zip"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { env } from "../../apps/api/src/config.js"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { env } from "../../../apps/api/src/config.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/system-jobs.test.ts b/tests/integration/platform/system-jobs.test.ts similarity index 95% rename from tests/integration/system-jobs.test.ts rename to tests/integration/platform/system-jobs.test.ts index 58a23747..345d33ba 100644 --- a/tests/integration/system-jobs.test.ts +++ b/tests/integration/platform/system-jobs.test.ts @@ -8,18 +8,18 @@ import { join } from "node:path"; import type { Job } from "bullmq"; import { eq, sql } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { env } from "../../apps/api/src/config.js"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { runMigrations } from "../../apps/api/src/db/migrate.js"; -import { closeQueues, getQueue } from "../../apps/api/src/jobs/queues.js"; +import { env } from "../../../apps/api/src/config.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { runMigrations } from "../../../apps/api/src/db/migrate.js"; +import { closeQueues, getQueue } from "../../../apps/api/src/jobs/queues.js"; import { decideExpiry, runSystemJob, SYSTEM_JOBS, scheduleSystemJobs, -} from "../../apps/api/src/jobs/system-jobs.js"; -import type { ObjectInfo } from "../../apps/api/src/lib/object-storage.js"; -import * as objectStorage from "../../apps/api/src/lib/object-storage.js"; +} from "../../../apps/api/src/jobs/system-jobs.js"; +import type { ObjectInfo } from "../../../apps/api/src/lib/object-storage.js"; +import * as objectStorage from "../../../apps/api/src/lib/object-storage.js"; beforeAll(async () => { await runMigrations(); diff --git a/tests/integration/teams.test.ts b/tests/integration/platform/teams.test.ts similarity index 98% rename from tests/integration/teams.test.ts rename to tests/integration/platform/teams.test.ts index 4bb2b88f..575c695b 100644 --- a/tests/integration/teams.test.ts +++ b/tests/integration/platform/teams.test.ts @@ -8,8 +8,8 @@ import { randomUUID } from "node:crypto"; import { eq, sql } from "drizzle-orm"; import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/tool-async-window.test.ts b/tests/integration/platform/tool-async-window.test.ts similarity index 95% rename from tests/integration/tool-async-window.test.ts rename to tests/integration/platform/tool-async-window.test.ts index a065f282..b665fe1f 100644 --- a/tests/integration/tool-async-window.test.ts +++ b/tests/integration/platform/tool-async-window.test.ts @@ -7,10 +7,15 @@ */ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { sharedRedis } from "../../apps/api/src/jobs/connection.js"; -import { bullPrefix } from "../../apps/api/src/jobs/types.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { sharedRedis } from "../../../apps/api/src/jobs/connection.js"; +import { bullPrefix } from "../../../apps/api/src/jobs/types.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/tracing-lifecycle.test.ts b/tests/integration/platform/tracing-lifecycle.test.ts similarity index 100% rename from tests/integration/tracing-lifecycle.test.ts rename to tests/integration/platform/tracing-lifecycle.test.ts diff --git a/tests/integration/upgrade-management.test.ts b/tests/integration/platform/upgrade-management.test.ts similarity index 96% rename from tests/integration/upgrade-management.test.ts rename to tests/integration/platform/upgrade-management.test.ts index 6bc91206..96d2c6ff 100644 --- a/tests/integration/upgrade-management.test.ts +++ b/tests/integration/platform/upgrade-management.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; @@ -80,9 +80,9 @@ describe("upgrade management - with enterprise license", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["upgrade_management"]); - const { buildTestApp, loginAsAdmin } = await import("./test-server.js"); + const { buildTestApp, loginAsAdmin } = await import("../test-server.js"); entApp = await buildTestApp(); entAdminToken = await loginAsAdmin(entApp.app); }, 30_000); diff --git a/tests/integration/usage-endpoint.test.ts b/tests/integration/platform/usage-endpoint.test.ts similarity index 97% rename from tests/integration/usage-endpoint.test.ts rename to tests/integration/platform/usage-endpoint.test.ts index f91bb004..c11c7985 100644 --- a/tests/integration/usage-endpoint.test.ts +++ b/tests/integration/platform/usage-endpoint.test.ts @@ -7,8 +7,8 @@ import { randomUUID } from "node:crypto"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/user-files.test.ts b/tests/integration/platform/user-files.test.ts similarity index 99% rename from tests/integration/user-files.test.ts rename to tests/integration/platform/user-files.test.ts index c335030a..5e1edf23 100644 --- a/tests/integration/user-files.test.ts +++ b/tests/integration/platform/user-files.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/webhook-management.test.ts b/tests/integration/platform/webhook-management.test.ts similarity index 97% rename from tests/integration/webhook-management.test.ts rename to tests/integration/platform/webhook-management.test.ts index b5c3531e..8fe4fc09 100644 --- a/tests/integration/webhook-management.test.ts +++ b/tests/integration/platform/webhook-management.test.ts @@ -1,7 +1,7 @@ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; describe("webhook management", () => { describe("without enterprise license", () => { @@ -96,9 +96,9 @@ describe("webhook management", () => { beforeAll(async () => { vi.resetModules(); - const { mockEnterpriseFeatures } = await import("../helpers/enterprise-mock.js"); + const { mockEnterpriseFeatures } = await import("../../helpers/enterprise-mock.js"); mockEnterpriseFeatures(["admin_alerts", "webhooks"]); - const testServer = await import("./test-server.js"); + const testServer = await import("../test-server.js"); testApp = await testServer.buildTestApp(); adminToken = await testServer.loginAsAdmin(testApp.app); }, 30_000); diff --git a/tests/integration/worker-timeout.test.ts b/tests/integration/platform/worker-timeout.test.ts similarity index 83% rename from tests/integration/worker-timeout.test.ts rename to tests/integration/platform/worker-timeout.test.ts index 54e0834b..d4c50ee2 100644 --- a/tests/integration/worker-timeout.test.ts +++ b/tests/integration/platform/worker-timeout.test.ts @@ -15,17 +15,17 @@ process.env.JOB_TIMEOUT_FAST_S = "1"; // Dynamic imports so config.ts picks up the 1-second timeout. const { eq } = await import("drizzle-orm"); -const { db, schema } = await import("../../apps/api/src/db/index.js"); +const { db, schema } = await import("../../../apps/api/src/db/index.js"); const { startCancelListener, stopCancelListener } = await import( - "../../apps/api/src/jobs/cancel.js" + "../../../apps/api/src/jobs/cancel.js" ); -const { sharedRedis } = await import("../../apps/api/src/jobs/connection.js"); -const { enqueueToolJob } = await import("../../apps/api/src/jobs/enqueue.js"); -const { bullPrefix } = await import("../../apps/api/src/jobs/types.js"); -const { closeWorkers, startWorkers } = await import("../../apps/api/src/jobs/worker.js"); -const { putObject } = await import("../../apps/api/src/lib/object-storage.js"); -const { registerToolProcessFn } = await import("../../apps/api/src/routes/tool-factory.js"); -const { env } = await import("../../apps/api/src/config.js"); +const { sharedRedis } = await import("../../../apps/api/src/jobs/connection.js"); +const { enqueueToolJob } = await import("../../../apps/api/src/jobs/enqueue.js"); +const { bullPrefix } = await import("../../../apps/api/src/jobs/types.js"); +const { closeWorkers, startWorkers } = await import("../../../apps/api/src/jobs/worker.js"); +const { putObject } = await import("../../../apps/api/src/lib/object-storage.js"); +const { registerToolProcessFn } = await import("../../../apps/api/src/routes/tool-factory.js"); +const { env } = await import("../../../apps/api/src/config.js"); // Sanity: the env override must have taken effect. if (env.JOB_TIMEOUT_FAST_S !== 1) { @@ -42,7 +42,7 @@ registerToolProcessFn({ inputBuffer: Buffer, _settings: unknown, filename: string, - ctx?: import("../../apps/api/src/routes/tool-factory.js").ToolProcessCtx, + ctx?: import("../../../apps/api/src/routes/tool-factory.js").ToolProcessCtx, ) => { // Loop for up to 30s, checking signal every 100ms. for (let i = 0; i < 300; i++) { @@ -62,7 +62,7 @@ const wsPath = process.env.WORKSPACE_PATH ?? ""; mkdirSync(wsPath, { recursive: true }); // Run migrations so the jobs table exists in this fork's DB. -const { runMigrations } = await import("../../apps/api/src/db/migrate.js"); +const { runMigrations } = await import("../../../apps/api/src/db/migrate.js"); await runMigrations(); beforeAll(async () => { diff --git a/tests/integration/adversarial-comprehensive.test.ts b/tests/integration/security/adversarial-comprehensive.test.ts similarity index 99% rename from tests/integration/adversarial-comprehensive.test.ts rename to tests/integration/security/adversarial-comprehensive.test.ts index e462e738..f0de96f0 100644 --- a/tests/integration/adversarial-comprehensive.test.ts +++ b/tests/integration/security/adversarial-comprehensive.test.ts @@ -18,8 +18,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/adversarial-coverage-gaps.test.ts b/tests/integration/security/adversarial-coverage-gaps.test.ts similarity index 99% rename from tests/integration/adversarial-coverage-gaps.test.ts rename to tests/integration/security/adversarial-coverage-gaps.test.ts index 79b760e3..ed1c6eb8 100644 --- a/tests/integration/adversarial-coverage-gaps.test.ts +++ b/tests/integration/security/adversarial-coverage-gaps.test.ts @@ -19,8 +19,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/adversarial-extended.test.ts b/tests/integration/security/adversarial-extended.test.ts similarity index 99% rename from tests/integration/adversarial-extended.test.ts rename to tests/integration/security/adversarial-extended.test.ts index 28a3141d..1752be13 100644 --- a/tests/integration/adversarial-extended.test.ts +++ b/tests/integration/security/adversarial-extended.test.ts @@ -10,8 +10,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/adversarial-final-gaps.test.ts b/tests/integration/security/adversarial-final-gaps.test.ts similarity index 99% rename from tests/integration/adversarial-final-gaps.test.ts rename to tests/integration/security/adversarial-final-gaps.test.ts index c7cf8f88..1a73a4a3 100644 --- a/tests/integration/adversarial-final-gaps.test.ts +++ b/tests/integration/security/adversarial-final-gaps.test.ts @@ -18,8 +18,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/adversarial-matrix.test.ts b/tests/integration/security/adversarial-matrix.test.ts similarity index 99% rename from tests/integration/adversarial-matrix.test.ts rename to tests/integration/security/adversarial-matrix.test.ts index b87d17c7..93ac7f2c 100644 --- a/tests/integration/adversarial-matrix.test.ts +++ b/tests/integration/security/adversarial-matrix.test.ts @@ -16,8 +16,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/adversarial-security.test.ts b/tests/integration/security/adversarial-security.test.ts similarity index 99% rename from tests/integration/adversarial-security.test.ts rename to tests/integration/security/adversarial-security.test.ts index 90c8dbd8..2062e525 100644 --- a/tests/integration/adversarial-security.test.ts +++ b/tests/integration/security/adversarial-security.test.ts @@ -16,8 +16,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/adversarial.test.ts b/tests/integration/security/adversarial.test.ts similarity index 99% rename from tests/integration/adversarial.test.ts rename to tests/integration/security/adversarial.test.ts index fe4c685a..b090a22a 100644 --- a/tests/integration/adversarial.test.ts +++ b/tests/integration/security/adversarial.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; // --------------------------------------------------------------------------- // Fixtures diff --git a/tests/integration/hostile-inputs.test.ts b/tests/integration/security/hostile-inputs.test.ts similarity index 94% rename from tests/integration/hostile-inputs.test.ts rename to tests/integration/security/hostile-inputs.test.ts index 146a3ff9..55bc3117 100644 --- a/tests/integration/hostile-inputs.test.ts +++ b/tests/integration/security/hostile-inputs.test.ts @@ -2,9 +2,14 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { TOOL_DISPLAY_MODES } from "../../apps/web/src/lib/tool-display-modes.js"; -import { fixtureDir } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { TOOL_DISPLAY_MODES } from "../../../apps/web/src/lib/tool-display-modes.js"; +import { fixtureDir } from "../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; /** * Hostile-input matrix: every tool route must reject malformed, truncated, diff --git a/tests/integration/security-auth-hardening.test.ts b/tests/integration/security/security-auth-hardening.test.ts similarity index 97% rename from tests/integration/security-auth-hardening.test.ts rename to tests/integration/security/security-auth-hardening.test.ts index ec476b88..95ff6800 100644 --- a/tests/integration/security-auth-hardening.test.ts +++ b/tests/integration/security/security-auth-hardening.test.ts @@ -5,8 +5,8 @@ */ import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/security-rate-limiting.test.ts b/tests/integration/security/security-rate-limiting.test.ts similarity index 96% rename from tests/integration/security-rate-limiting.test.ts rename to tests/integration/security/security-rate-limiting.test.ts index a9104f60..8350952c 100644 --- a/tests/integration/security-rate-limiting.test.ts +++ b/tests/integration/security/security-rate-limiting.test.ts @@ -10,8 +10,13 @@ */ import { eq, sql } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../apps/api/src/db/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/audio-channels.test.ts b/tests/integration/tools/audio/audio-channels.test.ts similarity index 94% rename from tests/integration/audio-channels.test.ts rename to tests/integration/tools/audio/audio-channels.test.ts index 76b6f2ab..66ea70b4 100644 --- a/tests/integration/audio-channels.test.ts +++ b/tests/integration/tools/audio/audio-channels.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const STEREO = readFixture(fixtures.audio.stereo); const MONO_MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/audio-metadata.test.ts b/tests/integration/tools/audio/audio-metadata.test.ts similarity index 93% rename from tests/integration/audio-metadata.test.ts rename to tests/integration/tools/audio/audio-metadata.test.ts index 8b225513..a9d1d5e7 100644 --- a/tests/integration/audio-metadata.test.ts +++ b/tests/integration/tools/audio/audio-metadata.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/audio-speed.test.ts b/tests/integration/tools/audio/audio-speed.test.ts similarity index 91% rename from tests/integration/audio-speed.test.ts rename to tests/integration/tools/audio/audio-speed.test.ts index 227c2182..d1e953d1 100644 --- a/tests/integration/audio-speed.test.ts +++ b/tests/integration/tools/audio/audio-speed.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/convert-audio.test.ts b/tests/integration/tools/audio/convert-audio.test.ts similarity index 92% rename from tests/integration/convert-audio.test.ts rename to tests/integration/tools/audio/convert-audio.test.ts index 9af6ef66..ad843d9c 100644 --- a/tests/integration/convert-audio.test.ts +++ b/tests/integration/tools/audio/convert-audio.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const WAV = readFixture(fixtures.audio.tiny("wav")); const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/fade-audio.test.ts b/tests/integration/tools/audio/fade-audio.test.ts similarity index 89% rename from tests/integration/fade-audio.test.ts rename to tests/integration/tools/audio/fade-audio.test.ts index 8554d151..e81ac862 100644 --- a/tests/integration/fade-audio.test.ts +++ b/tests/integration/tools/audio/fade-audio.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/merge-audio.test.ts b/tests/integration/tools/audio/merge-audio.test.ts similarity index 93% rename from tests/integration/merge-audio.test.ts rename to tests/integration/tools/audio/merge-audio.test.ts index 38bd90d3..08c267c5 100644 --- a/tests/integration/merge-audio.test.ts +++ b/tests/integration/tools/audio/merge-audio.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); const WAV = readFixture(fixtures.audio.tiny("wav")); diff --git a/tests/integration/noise-reduction.test.ts b/tests/integration/tools/audio/noise-reduction.test.ts similarity index 90% rename from tests/integration/noise-reduction.test.ts rename to tests/integration/tools/audio/noise-reduction.test.ts index 624d187a..6c20f409 100644 --- a/tests/integration/noise-reduction.test.ts +++ b/tests/integration/tools/audio/noise-reduction.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/normalize-audio.test.ts b/tests/integration/tools/audio/normalize-audio.test.ts similarity index 88% rename from tests/integration/normalize-audio.test.ts rename to tests/integration/tools/audio/normalize-audio.test.ts index 8f85f480..927074cf 100644 --- a/tests/integration/normalize-audio.test.ts +++ b/tests/integration/tools/audio/normalize-audio.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const WAV = readFixture(fixtures.audio.tiny("wav")); diff --git a/tests/integration/pitch-shift.test.ts b/tests/integration/tools/audio/pitch-shift.test.ts similarity index 91% rename from tests/integration/pitch-shift.test.ts rename to tests/integration/tools/audio/pitch-shift.test.ts index a75ca3f9..cfcf4aaa 100644 --- a/tests/integration/pitch-shift.test.ts +++ b/tests/integration/tools/audio/pitch-shift.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/reverse-audio.test.ts b/tests/integration/tools/audio/reverse-audio.test.ts similarity index 92% rename from tests/integration/reverse-audio.test.ts rename to tests/integration/tools/audio/reverse-audio.test.ts index 096cdf3a..64c83e36 100644 --- a/tests/integration/reverse-audio.test.ts +++ b/tests/integration/tools/audio/reverse-audio.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/ringtone-maker.test.ts b/tests/integration/tools/audio/ringtone-maker.test.ts similarity index 89% rename from tests/integration/ringtone-maker.test.ts rename to tests/integration/tools/audio/ringtone-maker.test.ts index 87243167..d5564729 100644 --- a/tests/integration/ringtone-maker.test.ts +++ b/tests/integration/tools/audio/ringtone-maker.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/silence-removal.test.ts b/tests/integration/tools/audio/silence-removal.test.ts similarity index 91% rename from tests/integration/silence-removal.test.ts rename to tests/integration/tools/audio/silence-removal.test.ts index c53d0b1d..b3df45e2 100644 --- a/tests/integration/silence-removal.test.ts +++ b/tests/integration/tools/audio/silence-removal.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const TONE_GAP = readFixture(fixtures.audio.gap); diff --git a/tests/integration/split-audio.test.ts b/tests/integration/tools/audio/split-audio.test.ts similarity index 96% rename from tests/integration/split-audio.test.ts rename to tests/integration/tools/audio/split-audio.test.ts index 3072a555..44b8a020 100644 --- a/tests/integration/split-audio.test.ts +++ b/tests/integration/tools/audio/split-audio.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); const TONE_GAP = readFixture(fixtures.audio.gap); diff --git a/tests/integration/transcribe-audio.test.ts b/tests/integration/tools/audio/transcribe-audio.test.ts similarity index 96% rename from tests/integration/transcribe-audio.test.ts rename to tests/integration/tools/audio/transcribe-audio.test.ts index ee8a01df..7f2a0156 100644 --- a/tests/integration/transcribe-audio.test.ts +++ b/tests/integration/tools/audio/transcribe-audio.test.ts @@ -9,8 +9,13 @@ import { readFileSync } from "node:fs"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MEDIA = fixtureDir.media; const MP3 = readFileSync(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/trim-audio.test.ts b/tests/integration/tools/audio/trim-audio.test.ts similarity index 92% rename from tests/integration/trim-audio.test.ts rename to tests/integration/tools/audio/trim-audio.test.ts index 3bbc7923..5966aaaa 100644 --- a/tests/integration/trim-audio.test.ts +++ b/tests/integration/tools/audio/trim-audio.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/volume-adjust.test.ts b/tests/integration/tools/audio/volume-adjust.test.ts similarity index 91% rename from tests/integration/volume-adjust.test.ts rename to tests/integration/tools/audio/volume-adjust.test.ts index 063d6d5a..113de5b9 100644 --- a/tests/integration/volume-adjust.test.ts +++ b/tests/integration/tools/audio/volume-adjust.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/waveform-image.test.ts b/tests/integration/tools/audio/waveform-image.test.ts similarity index 90% rename from tests/integration/waveform-image.test.ts rename to tests/integration/tools/audio/waveform-image.test.ts index 876043d5..97b71af4 100644 --- a/tests/integration/waveform-image.test.ts +++ b/tests/integration/tools/audio/waveform-image.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/chart-maker.test.ts b/tests/integration/tools/data/chart-maker.test.ts similarity index 98% rename from tests/integration/chart-maker.test.ts rename to tests/integration/tools/data/chart-maker.test.ts index 3943da52..4be9ab46 100644 --- a/tests/integration/chart-maker.test.ts +++ b/tests/integration/tools/data/chart-maker.test.ts @@ -12,7 +12,12 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/create-zip.test.ts b/tests/integration/tools/data/create-zip.test.ts similarity index 92% rename from tests/integration/create-zip.test.ts rename to tests/integration/tools/data/create-zip.test.ts index 1aa3061d..e9c72bde 100644 --- a/tests/integration/create-zip.test.ts +++ b/tests/integration/tools/data/create-zip.test.ts @@ -1,6 +1,11 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const CSV_A = readFixture(fixtures.data.csvA); const CSV_B = readFixture(fixtures.data.csvB); diff --git a/tests/integration/csv-excel.test.ts b/tests/integration/tools/data/csv-excel.test.ts similarity index 94% rename from tests/integration/csv-excel.test.ts rename to tests/integration/tools/data/csv-excel.test.ts index b6d68231..f0121daf 100644 --- a/tests/integration/csv-excel.test.ts +++ b/tests/integration/tools/data/csv-excel.test.ts @@ -1,7 +1,12 @@ import AdmZip from "adm-zip"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const CSV = readFixture(fixtures.data.csv); const TSV = readFixture(fixtures.data.tsv); diff --git a/tests/integration/csv-json.test.ts b/tests/integration/tools/data/csv-json.test.ts similarity index 94% rename from tests/integration/csv-json.test.ts rename to tests/integration/tools/data/csv-json.test.ts index 4005c60e..729d3fc7 100644 --- a/tests/integration/csv-json.test.ts +++ b/tests/integration/tools/data/csv-json.test.ts @@ -1,6 +1,11 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const CSV = readFixture(fixtures.data.csv); const TSV = readFixture(fixtures.data.tsv); diff --git a/tests/integration/extract-zip.test.ts b/tests/integration/tools/data/extract-zip.test.ts similarity index 96% rename from tests/integration/extract-zip.test.ts rename to tests/integration/tools/data/extract-zip.test.ts index a0e1cd39..77552ac8 100644 --- a/tests/integration/extract-zip.test.ts +++ b/tests/integration/tools/data/extract-zip.test.ts @@ -5,8 +5,13 @@ import { join } from "node:path"; import AdmZip from "adm-zip"; import archiver from "archiver"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const CSV_A = readFixture(fixtures.data.csvA); const CSV_B = readFixture(fixtures.data.csvB); diff --git a/tests/integration/json-xml.test.ts b/tests/integration/tools/data/json-xml.test.ts similarity index 92% rename from tests/integration/json-xml.test.ts rename to tests/integration/tools/data/json-xml.test.ts index d033c38d..98d0bf6c 100644 --- a/tests/integration/json-xml.test.ts +++ b/tests/integration/tools/data/json-xml.test.ts @@ -1,6 +1,11 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const JSON_FIXTURE = readFixture(fixtures.data.json); const XML_FIXTURE = readFixture(fixtures.data.xml); diff --git a/tests/integration/merge-csvs.test.ts b/tests/integration/tools/data/merge-csvs.test.ts similarity index 94% rename from tests/integration/merge-csvs.test.ts rename to tests/integration/tools/data/merge-csvs.test.ts index 0c22eb5d..3cb34537 100644 --- a/tests/integration/merge-csvs.test.ts +++ b/tests/integration/tools/data/merge-csvs.test.ts @@ -1,6 +1,11 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const CSV_A = readFixture(fixtures.data.csvA); const CSV_B = readFixture(fixtures.data.csvB); diff --git a/tests/integration/split-csv.test.ts b/tests/integration/tools/data/split-csv.test.ts similarity index 95% rename from tests/integration/split-csv.test.ts rename to tests/integration/tools/data/split-csv.test.ts index 2c86b7f0..96217211 100644 --- a/tests/integration/split-csv.test.ts +++ b/tests/integration/tools/data/split-csv.test.ts @@ -1,7 +1,12 @@ import AdmZip from "adm-zip"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const CSV = readFixture(fixtures.data.csv); const TSV = readFixture(fixtures.data.tsv); diff --git a/tests/integration/xml-to-csv.test.ts b/tests/integration/tools/data/xml-to-csv.test.ts similarity index 95% rename from tests/integration/xml-to-csv.test.ts rename to tests/integration/tools/data/xml-to-csv.test.ts index a1f04e3c..e2489f12 100644 --- a/tests/integration/xml-to-csv.test.ts +++ b/tests/integration/tools/data/xml-to-csv.test.ts @@ -1,5 +1,10 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; let testApp: TestApp; let adminToken: string; diff --git a/tests/integration/yaml-json.test.ts b/tests/integration/tools/data/yaml-json.test.ts similarity index 93% rename from tests/integration/yaml-json.test.ts rename to tests/integration/tools/data/yaml-json.test.ts index b1b51aab..285637fc 100644 --- a/tests/integration/yaml-json.test.ts +++ b/tests/integration/tools/data/yaml-json.test.ts @@ -1,6 +1,11 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const YAML = readFixture(fixtures.data.yaml); diff --git a/tests/integration/booklet-pdf.test.ts b/tests/integration/tools/document/booklet-pdf.test.ts similarity index 89% rename from tests/integration/booklet-pdf.test.ts rename to tests/integration/tools/document/booklet-pdf.test.ts index 2fe18345..06583681 100644 --- a/tests/integration/booklet-pdf.test.ts +++ b/tests/integration/tools/document/booklet-pdf.test.ts @@ -1,7 +1,12 @@ import { pdfcpuAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/compress-pdf.test.ts b/tests/integration/tools/document/compress-pdf.test.ts similarity index 91% rename from tests/integration/compress-pdf.test.ts rename to tests/integration/tools/document/compress-pdf.test.ts index da3a01bd..80b55282 100644 --- a/tests/integration/compress-pdf.test.ts +++ b/tests/integration/tools/document/compress-pdf.test.ts @@ -1,7 +1,12 @@ import { gsAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/convert-document.test.ts b/tests/integration/tools/document/convert-document.test.ts similarity index 93% rename from tests/integration/convert-document.test.ts rename to tests/integration/tools/document/convert-document.test.ts index 69fa6609..46376b97 100644 --- a/tests/integration/convert-document.test.ts +++ b/tests/integration/tools/document/convert-document.test.ts @@ -5,8 +5,13 @@ import { sofficeAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const DOCX = readFixture(fixtures.document.tiny("docx")); const ODT = readFixture(fixtures.document.tiny("odt")); @@ -37,7 +42,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); // Poll the durable row until terminal (the long hint skips the sync window). - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/extract-pages.test.ts b/tests/integration/tools/document/extract-pages.test.ts similarity index 91% rename from tests/integration/extract-pages.test.ts rename to tests/integration/tools/document/extract-pages.test.ts index b217b2b5..59f21c47 100644 --- a/tests/integration/extract-pages.test.ts +++ b/tests/integration/tools/document/extract-pages.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/flatten-pdf.test.ts b/tests/integration/tools/document/flatten-pdf.test.ts similarity index 84% rename from tests/integration/flatten-pdf.test.ts rename to tests/integration/tools/document/flatten-pdf.test.ts index dfcd79b2..cafc5bf5 100644 --- a/tests/integration/flatten-pdf.test.ts +++ b/tests/integration/tools/document/flatten-pdf.test.ts @@ -1,7 +1,12 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { hasFitz } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { hasFitz } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/grayscale-pdf.test.ts b/tests/integration/tools/document/grayscale-pdf.test.ts similarity index 88% rename from tests/integration/grayscale-pdf.test.ts rename to tests/integration/tools/document/grayscale-pdf.test.ts index 4a0a8e8a..d5204c65 100644 --- a/tests/integration/grayscale-pdf.test.ts +++ b/tests/integration/tools/document/grayscale-pdf.test.ts @@ -1,7 +1,12 @@ import { gsAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/html-to-pdf.test.ts b/tests/integration/tools/document/html-to-pdf.test.ts similarity index 88% rename from tests/integration/html-to-pdf.test.ts rename to tests/integration/tools/document/html-to-pdf.test.ts index ee71446e..ccd5b984 100644 --- a/tests/integration/html-to-pdf.test.ts +++ b/tests/integration/tools/document/html-to-pdf.test.ts @@ -3,9 +3,14 @@ // the Docker compose smoke is the real end-to-end proof. import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { pythonWith } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { pythonWith } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const HTML = readFixture(fixtures.document.tiny("html")); const REMOTE_HTML = readFixture(fixtures.document.remoteImgHtml); @@ -42,7 +47,7 @@ describe.skipIf(!hasWeasyprint)("html-to-pdf (requires weasyprint)", () => { const res = await runTool("tiny.html", HTML); expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { @@ -64,7 +69,7 @@ describe.skipIf(!hasWeasyprint)("html-to-pdf (requires weasyprint)", () => { const res = await runTool("remote-img.html", REMOTE_HTML); expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; error: string | null } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/linearize-pdf.test.ts b/tests/integration/tools/document/linearize-pdf.test.ts similarity index 90% rename from tests/integration/linearize-pdf.test.ts rename to tests/integration/tools/document/linearize-pdf.test.ts index 8187c8a1..86cad73e 100644 --- a/tests/integration/linearize-pdf.test.ts +++ b/tests/integration/tools/document/linearize-pdf.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/markdown-to-docx.test.ts b/tests/integration/tools/document/markdown-to-docx.test.ts similarity index 92% rename from tests/integration/markdown-to-docx.test.ts rename to tests/integration/tools/document/markdown-to-docx.test.ts index ad12952a..4a713712 100644 --- a/tests/integration/markdown-to-docx.test.ts +++ b/tests/integration/tools/document/markdown-to-docx.test.ts @@ -5,8 +5,13 @@ import { pandocAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MD = readFixture(fixtures.document.tiny("md")); diff --git a/tests/integration/markdown-to-html.test.ts b/tests/integration/tools/document/markdown-to-html.test.ts similarity index 92% rename from tests/integration/markdown-to-html.test.ts rename to tests/integration/tools/document/markdown-to-html.test.ts index 14f8ec82..3eb46780 100644 --- a/tests/integration/markdown-to-html.test.ts +++ b/tests/integration/tools/document/markdown-to-html.test.ts @@ -5,8 +5,13 @@ import { pandocAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MD = readFixture(fixtures.document.tiny("md")); diff --git a/tests/integration/markdown-to-pdf.test.ts b/tests/integration/tools/document/markdown-to-pdf.test.ts similarity index 88% rename from tests/integration/markdown-to-pdf.test.ts rename to tests/integration/tools/document/markdown-to-pdf.test.ts index ab456438..caac598a 100644 --- a/tests/integration/markdown-to-pdf.test.ts +++ b/tests/integration/tools/document/markdown-to-pdf.test.ts @@ -3,9 +3,14 @@ // Both are Docker-only, absent locally; gated describes skip cleanly. import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { pythonWith } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { pythonWith } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MD = readFixture(fixtures.document.tiny("md")); @@ -44,7 +49,7 @@ describe.skipIf(!hasWeasyprint || !hasMarkdownMod)( const res = await runTool("tiny.md", MD); expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/merge-pdf.test.ts b/tests/integration/tools/document/merge-pdf.test.ts similarity index 93% rename from tests/integration/merge-pdf.test.ts rename to tests/integration/tools/document/merge-pdf.test.ts index 0909aba5..b0e56ef3 100644 --- a/tests/integration/merge-pdf.test.ts +++ b/tests/integration/tools/document/merge-pdf.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/nup-pdf.test.ts b/tests/integration/tools/document/nup-pdf.test.ts similarity index 89% rename from tests/integration/nup-pdf.test.ts rename to tests/integration/tools/document/nup-pdf.test.ts index 89b4269d..acc2329b 100644 --- a/tests/integration/nup-pdf.test.ts +++ b/tests/integration/tools/document/nup-pdf.test.ts @@ -1,7 +1,12 @@ import { pdfcpuAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/ocr-pdf.test.ts b/tests/integration/tools/document/ocr-pdf.test.ts similarity index 95% rename from tests/integration/ocr-pdf.test.ts rename to tests/integration/tools/document/ocr-pdf.test.ts index 71823eae..7f2abcfc 100644 --- a/tests/integration/ocr-pdf.test.ts +++ b/tests/integration/tools/document/ocr-pdf.test.ts @@ -9,8 +9,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/organize-pdf.test.ts b/tests/integration/tools/document/organize-pdf.test.ts similarity index 91% rename from tests/integration/organize-pdf.test.ts rename to tests/integration/tools/document/organize-pdf.test.ts index d9391fed..785d203e 100644 --- a/tests/integration/organize-pdf.test.ts +++ b/tests/integration/tools/document/organize-pdf.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/pdf-metadata.test.ts b/tests/integration/tools/document/pdf-metadata.test.ts similarity index 88% rename from tests/integration/pdf-metadata.test.ts rename to tests/integration/tools/document/pdf-metadata.test.ts index 36bfe98d..7ce4af1b 100644 --- a/tests/integration/pdf-metadata.test.ts +++ b/tests/integration/tools/document/pdf-metadata.test.ts @@ -1,7 +1,12 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { hasPikepdf } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { hasPikepdf } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/pdf-page-numbers.test.ts b/tests/integration/tools/document/pdf-page-numbers.test.ts similarity index 88% rename from tests/integration/pdf-page-numbers.test.ts rename to tests/integration/tools/document/pdf-page-numbers.test.ts index f41a1399..dc4728f2 100644 --- a/tests/integration/pdf-page-numbers.test.ts +++ b/tests/integration/tools/document/pdf-page-numbers.test.ts @@ -1,7 +1,12 @@ import { pdfcpuAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/pdf-to-image.test.ts b/tests/integration/tools/document/pdf-to-image.test.ts similarity index 99% rename from tests/integration/pdf-to-image.test.ts rename to tests/integration/tools/document/pdf-to-image.test.ts index 28bbb77f..ec96969e 100644 --- a/tests/integration/pdf-to-image.test.ts +++ b/tests/integration/tools/document/pdf-to-image.test.ts @@ -1,7 +1,12 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF_3PAGE = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/pdf-to-text.test.ts b/tests/integration/tools/document/pdf-to-text.test.ts similarity index 85% rename from tests/integration/pdf-to-text.test.ts rename to tests/integration/tools/document/pdf-to-text.test.ts index 05a94354..07c06eab 100644 --- a/tests/integration/pdf-to-text.test.ts +++ b/tests/integration/tools/document/pdf-to-text.test.ts @@ -1,7 +1,12 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { hasFitz } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { hasFitz } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/pdf-to-word.test.ts b/tests/integration/tools/document/pdf-to-word.test.ts similarity index 87% rename from tests/integration/pdf-to-word.test.ts rename to tests/integration/tools/document/pdf-to-word.test.ts index eb95f151..28e5ff44 100644 --- a/tests/integration/pdf-to-word.test.ts +++ b/tests/integration/tools/document/pdf-to-word.test.ts @@ -4,9 +4,14 @@ // pattern because pdf-to-word has executionHint "long". import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { pythonWith } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { pythonWith } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); const hasPdf2docx = pythonWith("pdf2docx"); @@ -42,7 +47,7 @@ describe.skipIf(!hasPdf2docx)("pdf-to-word (requires pdf2docx)", () => { expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); // Poll the durable row until terminal (the long hint skips the sync window). - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/pdfa-convert.test.ts b/tests/integration/tools/document/pdfa-convert.test.ts similarity index 88% rename from tests/integration/pdfa-convert.test.ts rename to tests/integration/tools/document/pdfa-convert.test.ts index 82646dee..f78e45eb 100644 --- a/tests/integration/pdfa-convert.test.ts +++ b/tests/integration/tools/document/pdfa-convert.test.ts @@ -1,7 +1,12 @@ import { gsAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/powerpoint-to-pdf.test.ts b/tests/integration/tools/document/powerpoint-to-pdf.test.ts similarity index 91% rename from tests/integration/powerpoint-to-pdf.test.ts rename to tests/integration/tools/document/powerpoint-to-pdf.test.ts index b2ed0a35..4c310ac3 100644 --- a/tests/integration/powerpoint-to-pdf.test.ts +++ b/tests/integration/tools/document/powerpoint-to-pdf.test.ts @@ -5,8 +5,13 @@ import { sofficeAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PPTX = readFixture(fixtures.document.tiny("pptx")); @@ -41,7 +46,7 @@ describe.skipIf(!sofficeAvailable())("powerpoint-to-pdf (requires soffice)", () expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); // Poll the durable row until terminal (the long hint skips the sync window). - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/protect-pdf.test.ts b/tests/integration/tools/document/protect-pdf.test.ts similarity index 91% rename from tests/integration/protect-pdf.test.ts rename to tests/integration/tools/document/protect-pdf.test.ts index efc35b5f..798c14a7 100644 --- a/tests/integration/protect-pdf.test.ts +++ b/tests/integration/tools/document/protect-pdf.test.ts @@ -1,9 +1,14 @@ import { qpdfAvailable } from "@snapotter/doc-engine"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../../apps/api/src/db/index.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/redact-pdf.test.ts b/tests/integration/tools/document/redact-pdf.test.ts similarity index 88% rename from tests/integration/redact-pdf.test.ts rename to tests/integration/tools/document/redact-pdf.test.ts index 9f520ab9..98cf0166 100644 --- a/tests/integration/redact-pdf.test.ts +++ b/tests/integration/tools/document/redact-pdf.test.ts @@ -1,7 +1,12 @@ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { hasFitz } from "../helpers/python-gate.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { hasFitz } from "../../../helpers/python-gate.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/remove-pages.test.ts b/tests/integration/tools/document/remove-pages.test.ts similarity index 96% rename from tests/integration/remove-pages.test.ts rename to tests/integration/tools/document/remove-pages.test.ts index 1d854625..4c9cf192 100644 --- a/tests/integration/remove-pages.test.ts +++ b/tests/integration/tools/document/remove-pages.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfMerge, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); const PDF_PATH = fixtures.document.pdf3; diff --git a/tests/integration/repair-pdf.test.ts b/tests/integration/tools/document/repair-pdf.test.ts similarity index 94% rename from tests/integration/repair-pdf.test.ts rename to tests/integration/tools/document/repair-pdf.test.ts index e0135447..944a0f25 100644 --- a/tests/integration/repair-pdf.test.ts +++ b/tests/integration/tools/document/repair-pdf.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/rotate-pdf.test.ts b/tests/integration/tools/document/rotate-pdf.test.ts similarity index 92% rename from tests/integration/rotate-pdf.test.ts rename to tests/integration/tools/document/rotate-pdf.test.ts index 8a176df4..0ba9b224 100644 --- a/tests/integration/rotate-pdf.test.ts +++ b/tests/integration/tools/document/rotate-pdf.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/split-pdf.test.ts b/tests/integration/tools/document/split-pdf.test.ts similarity index 94% rename from tests/integration/split-pdf.test.ts rename to tests/integration/tools/document/split-pdf.test.ts index 6c9f1795..09317a06 100644 --- a/tests/integration/split-pdf.test.ts +++ b/tests/integration/tools/document/split-pdf.test.ts @@ -2,8 +2,13 @@ import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import AdmZip from "adm-zip"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/to-epub.test.ts b/tests/integration/tools/document/to-epub.test.ts similarity index 91% rename from tests/integration/to-epub.test.ts rename to tests/integration/tools/document/to-epub.test.ts index 88927206..401ee5a3 100644 --- a/tests/integration/to-epub.test.ts +++ b/tests/integration/tools/document/to-epub.test.ts @@ -4,8 +4,13 @@ import { pandocAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MD = readFixture(fixtures.document.tiny("md")); @@ -40,7 +45,7 @@ describe.skipIf(!pandocAvailable())("to-epub (requires pandoc)", () => { // to-epub is a "long" tool: it returns 202 + jobId and runs async. expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown; error: { message: string } | null } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/unlock-pdf.test.ts b/tests/integration/tools/document/unlock-pdf.test.ts similarity index 91% rename from tests/integration/unlock-pdf.test.ts rename to tests/integration/tools/document/unlock-pdf.test.ts index 6197edbf..cce65540 100644 --- a/tests/integration/unlock-pdf.test.ts +++ b/tests/integration/tools/document/unlock-pdf.test.ts @@ -4,9 +4,14 @@ import { join } from "node:path"; import { qpdfAvailable, qpdfPageCount } from "@snapotter/doc-engine"; import { eq } from "drizzle-orm"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { db, schema } from "../../apps/api/src/db/index.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { db, schema } from "../../../../apps/api/src/db/index.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const ENCRYPTED = readFixture(fixtures.document.encrypted); diff --git a/tests/integration/watermark-pdf.test.ts b/tests/integration/tools/document/watermark-pdf.test.ts similarity index 90% rename from tests/integration/watermark-pdf.test.ts rename to tests/integration/tools/document/watermark-pdf.test.ts index 7153bb8a..15d4d3f6 100644 --- a/tests/integration/watermark-pdf.test.ts +++ b/tests/integration/tools/document/watermark-pdf.test.ts @@ -1,7 +1,12 @@ import { pdfcpuAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PDF = readFixture(fixtures.document.pdf3); diff --git a/tests/integration/word-to-pdf.test.ts b/tests/integration/tools/document/word-to-pdf.test.ts similarity index 89% rename from tests/integration/word-to-pdf.test.ts rename to tests/integration/tools/document/word-to-pdf.test.ts index 7d863548..1bfef1ae 100644 --- a/tests/integration/word-to-pdf.test.ts +++ b/tests/integration/tools/document/word-to-pdf.test.ts @@ -5,8 +5,13 @@ import { sofficeAvailable } from "@snapotter/doc-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const DOCX = readFixture(fixtures.document.tiny("docx")); @@ -41,7 +46,7 @@ describe.skipIf(!sofficeAvailable())("word-to-pdf (requires soffice)", () => { expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); // Poll the durable row until terminal (the long hint skips the sync window). - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/ai-canvas-expand.test.ts b/tests/integration/tools/image/ai-canvas-expand.test.ts similarity index 98% rename from tests/integration/ai-canvas-expand.test.ts rename to tests/integration/tools/image/ai-canvas-expand.test.ts index 5f1ed6ae..b751ca67 100644 --- a/tests/integration/ai-canvas-expand.test.ts +++ b/tests/integration/tools/image/ai-canvas-expand.test.ts @@ -8,8 +8,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/background-replace.test.ts b/tests/integration/tools/image/background-replace.test.ts similarity index 97% rename from tests/integration/background-replace.test.ts rename to tests/integration/tools/image/background-replace.test.ts index 54b126f4..ace2abeb 100644 --- a/tests/integration/background-replace.test.ts +++ b/tests/integration/tools/image/background-replace.test.ts @@ -11,8 +11,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/barcode-generate.test.ts b/tests/integration/tools/image/barcode-generate.test.ts similarity index 99% rename from tests/integration/barcode-generate.test.ts rename to tests/integration/tools/image/barcode-generate.test.ts index bbbb26aa..9c7ca581 100644 --- a/tests/integration/barcode-generate.test.ts +++ b/tests/integration/tools/image/barcode-generate.test.ts @@ -8,7 +8,7 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/barcode-read.test.ts b/tests/integration/tools/image/barcode-read.test.ts similarity index 99% rename from tests/integration/barcode-read.test.ts rename to tests/integration/tools/image/barcode-read.test.ts index 9e6639fa..ed39e64d 100644 --- a/tests/integration/barcode-read.test.ts +++ b/tests/integration/tools/image/barcode-read.test.ts @@ -10,8 +10,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PLAIN_PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/beautify.test.ts b/tests/integration/tools/image/beautify.test.ts similarity index 99% rename from tests/integration/beautify.test.ts rename to tests/integration/tools/image/beautify.test.ts index 34ca57a4..84180d73 100644 --- a/tests/integration/beautify.test.ts +++ b/tests/integration/tools/image/beautify.test.ts @@ -9,8 +9,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/blur-background.test.ts b/tests/integration/tools/image/blur-background.test.ts similarity index 97% rename from tests/integration/blur-background.test.ts rename to tests/integration/tools/image/blur-background.test.ts index d7584e8c..3634cd49 100644 --- a/tests/integration/blur-background.test.ts +++ b/tests/integration/tools/image/blur-background.test.ts @@ -11,8 +11,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/blur-faces.test.ts b/tests/integration/tools/image/blur-faces.test.ts similarity index 97% rename from tests/integration/blur-faces.test.ts rename to tests/integration/tools/image/blur-faces.test.ts index 4b39030e..af7fd19e 100644 --- a/tests/integration/blur-faces.test.ts +++ b/tests/integration/tools/image/blur-faces.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/border.test.ts b/tests/integration/tools/image/border.test.ts similarity index 99% rename from tests/integration/border.test.ts rename to tests/integration/tools/image/border.test.ts index 26c697a9..58329bf4 100644 --- a/tests/integration/border.test.ts +++ b/tests/integration/tools/image/border.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/bulk-rename.test.ts b/tests/integration/tools/image/bulk-rename.test.ts similarity index 99% rename from tests/integration/bulk-rename.test.ts rename to tests/integration/tools/image/bulk-rename.test.ts index 9e42ba8a..6c68bb95 100644 --- a/tests/integration/bulk-rename.test.ts +++ b/tests/integration/tools/image/bulk-rename.test.ts @@ -7,8 +7,13 @@ import AdmZip from "adm-zip"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/circle-crop.test.ts b/tests/integration/tools/image/circle-crop.test.ts similarity index 97% rename from tests/integration/circle-crop.test.ts rename to tests/integration/tools/image/circle-crop.test.ts index 44240422..fedbe494 100644 --- a/tests/integration/circle-crop.test.ts +++ b/tests/integration/tools/image/circle-crop.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/collage.test.ts b/tests/integration/tools/image/collage.test.ts similarity index 99% rename from tests/integration/collage.test.ts rename to tests/integration/tools/image/collage.test.ts index 5df12582..c08593fa 100644 --- a/tests/integration/collage.test.ts +++ b/tests/integration/tools/image/collage.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/color-adjustments.test.ts b/tests/integration/tools/image/color-adjustments.test.ts similarity index 99% rename from tests/integration/color-adjustments.test.ts rename to tests/integration/tools/image/color-adjustments.test.ts index dff291c4..f134ef71 100644 --- a/tests/integration/color-adjustments.test.ts +++ b/tests/integration/tools/image/color-adjustments.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/color-blindness.test.ts b/tests/integration/tools/image/color-blindness.test.ts similarity index 98% rename from tests/integration/color-blindness.test.ts rename to tests/integration/tools/image/color-blindness.test.ts index df1ffd90..045a4cb7 100644 --- a/tests/integration/color-blindness.test.ts +++ b/tests/integration/tools/image/color-blindness.test.ts @@ -1,7 +1,12 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/color-palette.test.ts b/tests/integration/tools/image/color-palette.test.ts similarity index 99% rename from tests/integration/color-palette.test.ts rename to tests/integration/tools/image/color-palette.test.ts index 62483187..1911a098 100644 --- a/tests/integration/color-palette.test.ts +++ b/tests/integration/tools/image/color-palette.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/colorize.test.ts b/tests/integration/tools/image/colorize.test.ts similarity index 97% rename from tests/integration/colorize.test.ts rename to tests/integration/tools/image/colorize.test.ts index 81a178ab..9b399023 100644 --- a/tests/integration/colorize.test.ts +++ b/tests/integration/tools/image/colorize.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/compare.test.ts b/tests/integration/tools/image/compare.test.ts similarity index 99% rename from tests/integration/compare.test.ts rename to tests/integration/tools/image/compare.test.ts index f6f5b933..69b9c6c7 100644 --- a/tests/integration/compare.test.ts +++ b/tests/integration/tools/image/compare.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/compose.test.ts b/tests/integration/tools/image/compose.test.ts similarity index 99% rename from tests/integration/compose.test.ts rename to tests/integration/tools/image/compose.test.ts index a0fd92b0..3141225f 100644 --- a/tests/integration/compose.test.ts +++ b/tests/integration/tools/image/compose.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/compress.test.ts b/tests/integration/tools/image/compress.test.ts similarity index 98% rename from tests/integration/compress.test.ts rename to tests/integration/tools/image/compress.test.ts index 86e5b073..723905ed 100644 --- a/tests/integration/compress.test.ts +++ b/tests/integration/tools/image/compress.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const FORMATS = fixtureDir.formats; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/content-aware-resize.test.ts b/tests/integration/tools/image/content-aware-resize.test.ts similarity index 99% rename from tests/integration/content-aware-resize.test.ts rename to tests/integration/tools/image/content-aware-resize.test.ts index 176053aa..b81bf675 100644 --- a/tests/integration/content-aware-resize.test.ts +++ b/tests/integration/tools/image/content-aware-resize.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG_200x150 = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/crop.test.ts b/tests/integration/tools/image/crop.test.ts similarity index 98% rename from tests/integration/crop.test.ts rename to tests/integration/tools/image/crop.test.ts index d3faee48..bef0bf48 100644 --- a/tests/integration/crop.test.ts +++ b/tests/integration/tools/image/crop.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/duotone.test.ts b/tests/integration/tools/image/duotone.test.ts similarity index 98% rename from tests/integration/duotone.test.ts rename to tests/integration/tools/image/duotone.test.ts index e9cdc5a4..eaa68cc6 100644 --- a/tests/integration/duotone.test.ts +++ b/tests/integration/tools/image/duotone.test.ts @@ -7,7 +7,12 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/edit-metadata.test.ts b/tests/integration/tools/image/edit-metadata.test.ts similarity index 99% rename from tests/integration/edit-metadata.test.ts rename to tests/integration/tools/image/edit-metadata.test.ts index aba382bd..25e6f0ef 100644 --- a/tests/integration/edit-metadata.test.ts +++ b/tests/integration/tools/image/edit-metadata.test.ts @@ -10,8 +10,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const EXIF_JPG = readFixture(fixtures.image.exifGps); const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/enhance-faces.test.ts b/tests/integration/tools/image/enhance-faces.test.ts similarity index 97% rename from tests/integration/enhance-faces.test.ts rename to tests/integration/tools/image/enhance-faces.test.ts index 33d7c398..98e9e358 100644 --- a/tests/integration/enhance-faces.test.ts +++ b/tests/integration/tools/image/enhance-faces.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/erase-object.test.ts b/tests/integration/tools/image/erase-object.test.ts similarity index 98% rename from tests/integration/erase-object.test.ts rename to tests/integration/tools/image/erase-object.test.ts index 322c903b..99a6a4ab 100644 --- a/tests/integration/erase-object.test.ts +++ b/tests/integration/tools/image/erase-object.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/favicon.test.ts b/tests/integration/tools/image/favicon.test.ts similarity index 99% rename from tests/integration/favicon.test.ts rename to tests/integration/tools/image/favicon.test.ts index 40f1a44b..edd24e0a 100644 --- a/tests/integration/favicon.test.ts +++ b/tests/integration/tools/image/favicon.test.ts @@ -10,8 +10,13 @@ import { execFileSync } from "node:child_process"; import AdmZip from "adm-zip"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; /** Check if ImageMagick is available on this system. */ function checkMagickAvailable(): boolean { diff --git a/tests/integration/find-duplicates.test.ts b/tests/integration/tools/image/find-duplicates.test.ts similarity index 99% rename from tests/integration/find-duplicates.test.ts rename to tests/integration/tools/image/find-duplicates.test.ts index 361c01c1..497c3ef3 100644 --- a/tests/integration/find-duplicates.test.ts +++ b/tests/integration/tools/image/find-duplicates.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/gif-tools.test.ts b/tests/integration/tools/image/gif-tools.test.ts similarity index 99% rename from tests/integration/gif-tools.test.ts rename to tests/integration/tools/image/gif-tools.test.ts index f3324be8..79d08acf 100644 --- a/tests/integration/gif-tools.test.ts +++ b/tests/integration/tools/image/gif-tools.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/gif-webp.test.ts b/tests/integration/tools/image/gif-webp.test.ts similarity index 96% rename from tests/integration/gif-webp.test.ts rename to tests/integration/tools/image/gif-webp.test.ts index 835f29d5..d43a7c05 100644 --- a/tests/integration/gif-webp.test.ts +++ b/tests/integration/tools/image/gif-webp.test.ts @@ -8,8 +8,13 @@ import { join } from "node:path"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const ANIMATED_GIF = readFixture(fixtures.image.animated.gif); const ANIMATED_WEBP = readFixture(fixtures.image.animated.webp); diff --git a/tests/integration/histogram.test.ts b/tests/integration/tools/image/histogram.test.ts similarity index 95% rename from tests/integration/histogram.test.ts rename to tests/integration/tools/image/histogram.test.ts index 0683f0a6..f9fafa55 100644 --- a/tests/integration/histogram.test.ts +++ b/tests/integration/tools/image/histogram.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/html-to-image.test.ts b/tests/integration/tools/image/html-to-image.test.ts similarity index 93% rename from tests/integration/html-to-image.test.ts rename to tests/integration/tools/image/html-to-image.test.ts index 6d702289..9881131b 100644 --- a/tests/integration/html-to-image.test.ts +++ b/tests/integration/tools/image/html-to-image.test.ts @@ -1,9 +1,9 @@ import sharp from "sharp"; import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../../test-server.js"; // Mock the browser service -- Chromium may not be available in CI -vi.mock("../../apps/api/src/lib/browser-service.js", () => { +vi.mock("../../../../apps/api/src/lib/browser-service.js", () => { // 1x1 red PNG as a predictable test fixture const TEST_PNG = Buffer.from( "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==", @@ -18,7 +18,7 @@ vi.mock("../../apps/api/src/lib/browser-service.js", () => { }); // Mock SSRF validation -- test env has no external network -vi.mock("../../apps/api/src/lib/ssrf.js", async (importOriginal) => { +vi.mock("../../../../apps/api/src/lib/ssrf.js", async (importOriginal) => { const actual = (await importOriginal()) as Record; return { ...actual, @@ -156,7 +156,7 @@ describe("HTML to Image", () => { }); it("passes correct options to capturePage", async () => { - const { capturePage } = await import("../../apps/api/src/lib/browser-service.js"); + const { capturePage } = await import("../../../../apps/api/src/lib/browser-service.js"); (capturePage as ReturnType).mockClear(); await post( @@ -284,7 +284,9 @@ describe("HTML to Image", () => { describe("browser unavailable (503)", () => { it("returns 503 when browser is not installed", async () => { - const { isBrowserAvailable } = await import("../../apps/api/src/lib/browser-service.js"); + const { isBrowserAvailable } = await import( + "../../../../apps/api/src/lib/browser-service.js" + ); (isBrowserAvailable as ReturnType).mockReturnValueOnce(false); const res = await post({ url: "https://example.com" }, adminToken); @@ -295,7 +297,7 @@ describe("HTML to Image", () => { describe("capture errors", () => { it("returns 504 on page load timeout", async () => { - const { capturePage } = await import("../../apps/api/src/lib/browser-service.js"); + const { capturePage } = await import("../../../../apps/api/src/lib/browser-service.js"); (capturePage as ReturnType).mockRejectedValueOnce( new Error("Timeout 30000ms exceeded"), ); @@ -305,7 +307,7 @@ describe("HTML to Image", () => { }); it("returns 422 on generic capture failure", async () => { - const { capturePage } = await import("../../apps/api/src/lib/browser-service.js"); + const { capturePage } = await import("../../../../apps/api/src/lib/browser-service.js"); (capturePage as ReturnType).mockRejectedValueOnce( new Error("net::ERR_CONNECTION_REFUSED"), ); @@ -315,7 +317,7 @@ describe("HTML to Image", () => { }); it("returns 503 when browser service is crashed", async () => { - const { capturePage } = await import("../../apps/api/src/lib/browser-service.js"); + const { capturePage } = await import("../../../../apps/api/src/lib/browser-service.js"); (capturePage as ReturnType).mockRejectedValueOnce( new Error("Browser service permanently disabled after repeated crashes"), ); @@ -351,7 +353,7 @@ describe("HTML to Image", () => { }); it("does not perform SSRF check for html mode", async () => { - const { validateFetchUrl } = await import("../../apps/api/src/lib/ssrf.js"); + const { validateFetchUrl } = await import("../../../../apps/api/src/lib/ssrf.js"); (validateFetchUrl as ReturnType).mockClear(); await post({ html: "test" }, adminToken); diff --git a/tests/integration/image-enhancement.test.ts b/tests/integration/tools/image/image-enhancement.test.ts similarity index 99% rename from tests/integration/image-enhancement.test.ts rename to tests/integration/tools/image/image-enhancement.test.ts index d4b98920..e648fb51 100644 --- a/tests/integration/image-enhancement.test.ts +++ b/tests/integration/tools/image/image-enhancement.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; vi.setConfig({ testTimeout: 60_000 }); diff --git a/tests/integration/image-pad.test.ts b/tests/integration/tools/image/image-pad.test.ts similarity index 96% rename from tests/integration/image-pad.test.ts rename to tests/integration/tools/image/image-pad.test.ts index c3dd5efe..a5cb4f76 100644 --- a/tests/integration/image-pad.test.ts +++ b/tests/integration/tools/image/image-pad.test.ts @@ -7,9 +7,14 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { canvasFor } from "../../apps/api/src/routes/tools/image-pad.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { canvasFor } from "../../../../apps/api/src/routes/tools/image-pad.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/image-to-base64.test.ts b/tests/integration/tools/image/image-to-base64.test.ts similarity index 99% rename from tests/integration/image-to-base64.test.ts rename to tests/integration/tools/image/image-to-base64.test.ts index 4fe725d8..19709bcb 100644 --- a/tests/integration/image-to-base64.test.ts +++ b/tests/integration/tools/image/image-to-base64.test.ts @@ -6,8 +6,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/image-to-pdf.test.ts b/tests/integration/tools/image/image-to-pdf.test.ts similarity index 99% rename from tests/integration/image-to-pdf.test.ts rename to tests/integration/tools/image/image-to-pdf.test.ts index 5481a36c..ced23e06 100644 --- a/tests/integration/image-to-pdf.test.ts +++ b/tests/integration/tools/image/image-to-pdf.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/info.test.ts b/tests/integration/tools/image/info.test.ts similarity index 99% rename from tests/integration/info.test.ts rename to tests/integration/tools/image/info.test.ts index 73b65a21..ea2ec92a 100644 --- a/tests/integration/info.test.ts +++ b/tests/integration/tools/image/info.test.ts @@ -6,8 +6,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/lqip-placeholder.test.ts b/tests/integration/tools/image/lqip-placeholder.test.ts similarity index 95% rename from tests/integration/lqip-placeholder.test.ts rename to tests/integration/tools/image/lqip-placeholder.test.ts index 89c0db7a..13550686 100644 --- a/tests/integration/lqip-placeholder.test.ts +++ b/tests/integration/tools/image/lqip-placeholder.test.ts @@ -5,8 +5,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/meme-generator.test.ts b/tests/integration/tools/image/meme-generator.test.ts similarity index 99% rename from tests/integration/meme-generator.test.ts rename to tests/integration/tools/image/meme-generator.test.ts index 8ec5aff0..a9b0bcdd 100644 --- a/tests/integration/meme-generator.test.ts +++ b/tests/integration/tools/image/meme-generator.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/noise-removal.test.ts b/tests/integration/tools/image/noise-removal.test.ts similarity index 97% rename from tests/integration/noise-removal.test.ts rename to tests/integration/tools/image/noise-removal.test.ts index 4b68fea8..27809b38 100644 --- a/tests/integration/noise-removal.test.ts +++ b/tests/integration/tools/image/noise-removal.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/ocr.test.ts b/tests/integration/tools/image/ocr.test.ts similarity index 97% rename from tests/integration/ocr.test.ts rename to tests/integration/tools/image/ocr.test.ts index e0457a08..07c37470 100644 --- a/tests/integration/ocr.test.ts +++ b/tests/integration/tools/image/ocr.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/optimize-for-web.test.ts b/tests/integration/tools/image/optimize-for-web.test.ts similarity index 99% rename from tests/integration/optimize-for-web.test.ts rename to tests/integration/tools/image/optimize-for-web.test.ts index 0043fe38..9dced3db 100644 --- a/tests/integration/optimize-for-web.test.ts +++ b/tests/integration/tools/image/optimize-for-web.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/passport-photo.test.ts b/tests/integration/tools/image/passport-photo.test.ts similarity index 98% rename from tests/integration/passport-photo.test.ts rename to tests/integration/tools/image/passport-photo.test.ts index f58b60a6..b496aa3d 100644 --- a/tests/integration/passport-photo.test.ts +++ b/tests/integration/tools/image/passport-photo.test.ts @@ -11,8 +11,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const HEIC = readFixture(fixtures.image.base.heic200); diff --git a/tests/integration/pixelate.test.ts b/tests/integration/tools/image/pixelate.test.ts similarity index 96% rename from tests/integration/pixelate.test.ts rename to tests/integration/tools/image/pixelate.test.ts index f593b083..3960658b 100644 --- a/tests/integration/pixelate.test.ts +++ b/tests/integration/tools/image/pixelate.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/qr-generate.test.ts b/tests/integration/tools/image/qr-generate.test.ts similarity index 99% rename from tests/integration/qr-generate.test.ts rename to tests/integration/tools/image/qr-generate.test.ts index 4c3c24b2..ffb4da58 100644 --- a/tests/integration/qr-generate.test.ts +++ b/tests/integration/tools/image/qr-generate.test.ts @@ -7,7 +7,7 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; +import { buildTestApp, loginAsAdmin, type TestApp } from "../../test-server.js"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/red-eye-removal.test.ts b/tests/integration/tools/image/red-eye-removal.test.ts similarity index 98% rename from tests/integration/red-eye-removal.test.ts rename to tests/integration/tools/image/red-eye-removal.test.ts index 148314db..0a7efb19 100644 --- a/tests/integration/red-eye-removal.test.ts +++ b/tests/integration/tools/image/red-eye-removal.test.ts @@ -8,8 +8,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/remove-background.test.ts b/tests/integration/tools/image/remove-background.test.ts similarity index 98% rename from tests/integration/remove-background.test.ts rename to tests/integration/tools/image/remove-background.test.ts index 049b95d5..565cb24a 100644 --- a/tests/integration/remove-background.test.ts +++ b/tests/integration/tools/image/remove-background.test.ts @@ -9,8 +9,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/replace-color.test.ts b/tests/integration/tools/image/replace-color.test.ts similarity index 99% rename from tests/integration/replace-color.test.ts rename to tests/integration/tools/image/replace-color.test.ts index 59e18bbe..3eea7f23 100644 --- a/tests/integration/replace-color.test.ts +++ b/tests/integration/tools/image/replace-color.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/resize.test.ts b/tests/integration/tools/image/resize.test.ts similarity index 97% rename from tests/integration/resize.test.ts rename to tests/integration/tools/image/resize.test.ts index 8346ff09..f98ca112 100644 --- a/tests/integration/resize.test.ts +++ b/tests/integration/tools/image/resize.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/restore-photo.test.ts b/tests/integration/tools/image/restore-photo.test.ts similarity index 98% rename from tests/integration/restore-photo.test.ts rename to tests/integration/tools/image/restore-photo.test.ts index 856ebb01..b6d7f118 100644 --- a/tests/integration/restore-photo.test.ts +++ b/tests/integration/tools/image/restore-photo.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/rotate.test.ts b/tests/integration/tools/image/rotate.test.ts similarity index 97% rename from tests/integration/rotate.test.ts rename to tests/integration/tools/image/rotate.test.ts index 328da616..d7cc3905 100644 --- a/tests/integration/rotate.test.ts +++ b/tests/integration/tools/image/rotate.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/sharpening.test.ts b/tests/integration/tools/image/sharpening.test.ts similarity index 99% rename from tests/integration/sharpening.test.ts rename to tests/integration/tools/image/sharpening.test.ts index 867e9db3..997b1225 100644 --- a/tests/integration/sharpening.test.ts +++ b/tests/integration/tools/image/sharpening.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/smart-crop.test.ts b/tests/integration/tools/image/smart-crop.test.ts similarity index 98% rename from tests/integration/smart-crop.test.ts rename to tests/integration/tools/image/smart-crop.test.ts index 2a486c88..219d579f 100644 --- a/tests/integration/smart-crop.test.ts +++ b/tests/integration/tools/image/smart-crop.test.ts @@ -13,8 +13,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const _JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/split.test.ts b/tests/integration/tools/image/split.test.ts similarity index 99% rename from tests/integration/split.test.ts rename to tests/integration/tools/image/split.test.ts index 2217fa3f..879a179a 100644 --- a/tests/integration/split.test.ts +++ b/tests/integration/tools/image/split.test.ts @@ -9,8 +9,13 @@ import AdmZip from "adm-zip"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/sprite-sheet.test.ts b/tests/integration/tools/image/sprite-sheet.test.ts similarity index 96% rename from tests/integration/sprite-sheet.test.ts rename to tests/integration/tools/image/sprite-sheet.test.ts index 9d0a713c..136e3c34 100644 --- a/tests/integration/sprite-sheet.test.ts +++ b/tests/integration/tools/image/sprite-sheet.test.ts @@ -6,8 +6,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/stitch.test.ts b/tests/integration/tools/image/stitch.test.ts similarity index 99% rename from tests/integration/stitch.test.ts rename to tests/integration/tools/image/stitch.test.ts index b993856f..d6970995 100644 --- a/tests/integration/stitch.test.ts +++ b/tests/integration/tools/image/stitch.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/strip-metadata.test.ts b/tests/integration/tools/image/strip-metadata.test.ts similarity index 99% rename from tests/integration/strip-metadata.test.ts rename to tests/integration/tools/image/strip-metadata.test.ts index a07038ee..5eacf2c5 100644 --- a/tests/integration/strip-metadata.test.ts +++ b/tests/integration/tools/image/strip-metadata.test.ts @@ -8,8 +8,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const EXIF_JPG = readFixture(fixtures.image.exifGps); const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/svg-to-raster.test.ts b/tests/integration/tools/image/svg-to-raster.test.ts similarity index 99% rename from tests/integration/svg-to-raster.test.ts rename to tests/integration/tools/image/svg-to-raster.test.ts index 3f960ac8..43f9d13f 100644 --- a/tests/integration/svg-to-raster.test.ts +++ b/tests/integration/tools/image/svg-to-raster.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const SVG = readFixture(fixtures.image.base.svg100); const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/text-overlay.test.ts b/tests/integration/tools/image/text-overlay.test.ts similarity index 99% rename from tests/integration/text-overlay.test.ts rename to tests/integration/tools/image/text-overlay.test.ts index 81687194..f3587c15 100644 --- a/tests/integration/text-overlay.test.ts +++ b/tests/integration/tools/image/text-overlay.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/transparency-fixer.test.ts b/tests/integration/tools/image/transparency-fixer.test.ts similarity index 98% rename from tests/integration/transparency-fixer.test.ts rename to tests/integration/tools/image/transparency-fixer.test.ts index 1aa45221..65aab4a8 100644 --- a/tests/integration/transparency-fixer.test.ts +++ b/tests/integration/tools/image/transparency-fixer.test.ts @@ -9,8 +9,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const FAKE_TRANSPARENCY = readFixture(fixtures.image.transparent); const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/upscale.test.ts b/tests/integration/tools/image/upscale.test.ts similarity index 98% rename from tests/integration/upscale.test.ts rename to tests/integration/tools/image/upscale.test.ts index 7944f638..af8b4a88 100644 --- a/tests/integration/upscale.test.ts +++ b/tests/integration/tools/image/upscale.test.ts @@ -8,8 +8,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const JPG = readFixture(fixtures.image.base.jpg100); diff --git a/tests/integration/vectorize.test.ts b/tests/integration/tools/image/vectorize.test.ts similarity index 99% rename from tests/integration/vectorize.test.ts rename to tests/integration/tools/image/vectorize.test.ts index 9a54530f..2252491e 100644 --- a/tests/integration/vectorize.test.ts +++ b/tests/integration/tools/image/vectorize.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const SMALL_PNG = readFixture(fixtures.image.edge.px1); diff --git a/tests/integration/vignette.test.ts b/tests/integration/tools/image/vignette.test.ts similarity index 96% rename from tests/integration/vignette.test.ts rename to tests/integration/tools/image/vignette.test.ts index 52e2594e..ebaae075 100644 --- a/tests/integration/vignette.test.ts +++ b/tests/integration/tools/image/vignette.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/watermark-image.test.ts b/tests/integration/tools/image/watermark-image.test.ts similarity index 99% rename from tests/integration/watermark-image.test.ts rename to tests/integration/tools/image/watermark-image.test.ts index 039f4102..ede46a9f 100644 --- a/tests/integration/watermark-image.test.ts +++ b/tests/integration/tools/image/watermark-image.test.ts @@ -7,8 +7,13 @@ */ import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); const SMALL_PNG = readFixture(fixtures.image.edge.px1); diff --git a/tests/integration/watermark-text.test.ts b/tests/integration/tools/image/watermark-text.test.ts similarity index 99% rename from tests/integration/watermark-text.test.ts rename to tests/integration/tools/image/watermark-text.test.ts index 7744bf0b..f9245353 100644 --- a/tests/integration/watermark-text.test.ts +++ b/tests/integration/tools/image/watermark-text.test.ts @@ -7,8 +7,13 @@ import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/aspect-pad.test.ts b/tests/integration/tools/video/aspect-pad.test.ts similarity index 92% rename from tests/integration/aspect-pad.test.ts rename to tests/integration/tools/video/aspect-pad.test.ts index d552bd43..5cada3f0 100644 --- a/tests/integration/aspect-pad.test.ts +++ b/tests/integration/tools/video/aspect-pad.test.ts @@ -3,9 +3,14 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { canvasFor } from "../../apps/api/src/routes/tools/aspect-pad.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { canvasFor } from "../../../../apps/api/src/routes/tools/aspect-pad.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/auto-subtitles.test.ts b/tests/integration/tools/video/auto-subtitles.test.ts similarity index 96% rename from tests/integration/auto-subtitles.test.ts rename to tests/integration/tools/video/auto-subtitles.test.ts index 730cef8b..7892b966 100644 --- a/tests/integration/auto-subtitles.test.ts +++ b/tests/integration/tools/video/auto-subtitles.test.ts @@ -9,8 +9,13 @@ import { readFileSync } from "node:fs"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtureDir, fixtures } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtureDir, fixtures } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MEDIA = fixtureDir.media; const MP4 = readFileSync(fixtures.video.tiny("mp4")); diff --git a/tests/integration/blur-pad.test.ts b/tests/integration/tools/video/blur-pad.test.ts similarity index 91% rename from tests/integration/blur-pad.test.ts rename to tests/integration/tools/video/blur-pad.test.ts index 135f616b..2c1e6495 100644 --- a/tests/integration/blur-pad.test.ts +++ b/tests/integration/tools/video/blur-pad.test.ts @@ -3,9 +3,14 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { canvasFor } from "../../apps/api/src/routes/tools/blur-pad.js"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { canvasFor } from "../../../../apps/api/src/routes/tools/blur-pad.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/burn-subtitles.test.ts b/tests/integration/tools/video/burn-subtitles.test.ts similarity index 95% rename from tests/integration/burn-subtitles.test.ts rename to tests/integration/tools/video/burn-subtitles.test.ts index 47302292..3d2ec5d2 100644 --- a/tests/integration/burn-subtitles.test.ts +++ b/tests/integration/tools/video/burn-subtitles.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); const SRT = readFixture(fixtures.video.subs.srt); @@ -43,7 +48,7 @@ async function resolveResult(res: Awaited> const { jobId } = JSON.parse(res.body); expect(jobId).toBeDefined(); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/change-fps.test.ts b/tests/integration/tools/video/change-fps.test.ts similarity index 95% rename from tests/integration/change-fps.test.ts rename to tests/integration/tools/video/change-fps.test.ts index a2196bb1..2c5ede95 100644 --- a/tests/integration/change-fps.test.ts +++ b/tests/integration/tools/video/change-fps.test.ts @@ -4,8 +4,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); const WEBM = readFixture(fixtures.video.tiny("webm")); diff --git a/tests/integration/compress-video.test.ts b/tests/integration/tools/video/compress-video.test.ts similarity index 89% rename from tests/integration/compress-video.test.ts rename to tests/integration/tools/video/compress-video.test.ts index a5d21904..3258b309 100644 --- a/tests/integration/compress-video.test.ts +++ b/tests/integration/tools/video/compress-video.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); @@ -18,7 +23,7 @@ afterAll(async () => { }, 10_000); async function pollJob(jobId: string) { - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/convert-video.test.ts b/tests/integration/tools/video/convert-video.test.ts similarity index 91% rename from tests/integration/convert-video.test.ts rename to tests/integration/tools/video/convert-video.test.ts index 609ccce4..8cdb5927 100644 --- a/tests/integration/convert-video.test.ts +++ b/tests/integration/tools/video/convert-video.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); @@ -36,7 +41,7 @@ describe.skipIf(!ffmpegAvailable())("convert-video (requires ffmpeg)", () => { expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); // Poll the durable row until terminal (the long hint skips the sync window). - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { @@ -59,7 +64,7 @@ describe.skipIf(!ffmpegAvailable())("convert-video (requires ffmpeg)", () => { const res = await runTool({ format: "mp4" }); expect(res.statusCode).toBe(202); const { jobId } = JSON.parse(res.body); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/crop-video.test.ts b/tests/integration/tools/video/crop-video.test.ts similarity index 92% rename from tests/integration/crop-video.test.ts rename to tests/integration/tools/video/crop-video.test.ts index be735137..c32b1004 100644 --- a/tests/integration/crop-video.test.ts +++ b/tests/integration/tools/video/crop-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/embed-subtitles.test.ts b/tests/integration/tools/video/embed-subtitles.test.ts similarity index 93% rename from tests/integration/embed-subtitles.test.ts rename to tests/integration/tools/video/embed-subtitles.test.ts index 92e60ad5..053cc9b8 100644 --- a/tests/integration/embed-subtitles.test.ts +++ b/tests/integration/tools/video/embed-subtitles.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); const SRT = readFixture(fixtures.video.subs.srt); diff --git a/tests/integration/extract-audio.test.ts b/tests/integration/tools/video/extract-audio.test.ts similarity index 92% rename from tests/integration/extract-audio.test.ts rename to tests/integration/tools/video/extract-audio.test.ts index ebecb8a9..e6fb20f0 100644 --- a/tests/integration/extract-audio.test.ts +++ b/tests/integration/tools/video/extract-audio.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/extract-subtitles.test.ts b/tests/integration/tools/video/extract-subtitles.test.ts similarity index 92% rename from tests/integration/extract-subtitles.test.ts rename to tests/integration/tools/video/extract-subtitles.test.ts index 720b414f..306d6fce 100644 --- a/tests/integration/extract-subtitles.test.ts +++ b/tests/integration/tools/video/extract-subtitles.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MKV = readFixture(fixtures.video.subs.mkv); const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/gif-to-video.test.ts b/tests/integration/tools/video/gif-to-video.test.ts similarity index 93% rename from tests/integration/gif-to-video.test.ts rename to tests/integration/tools/video/gif-to-video.test.ts index 14b4429c..4f08c45a 100644 --- a/tests/integration/gif-to-video.test.ts +++ b/tests/integration/tools/video/gif-to-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const GIF = readFixture(fixtures.image.animated.gif); diff --git a/tests/integration/images-to-video.test.ts b/tests/integration/tools/video/images-to-video.test.ts similarity index 94% rename from tests/integration/images-to-video.test.ts rename to tests/integration/tools/video/images-to-video.test.ts index c3a43c58..4accb7a6 100644 --- a/tests/integration/images-to-video.test.ts +++ b/tests/integration/tools/video/images-to-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const JPG = readFixture(fixtures.image.base.jpg100); const PNG = readFixture(fixtures.image.base.png200); diff --git a/tests/integration/merge-videos.test.ts b/tests/integration/tools/video/merge-videos.test.ts similarity index 93% rename from tests/integration/merge-videos.test.ts rename to tests/integration/tools/video/merge-videos.test.ts index 774743d8..7e1aeeb9 100644 --- a/tests/integration/merge-videos.test.ts +++ b/tests/integration/tools/video/merge-videos.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); @@ -40,7 +45,7 @@ async function resolveResult(res: Awaited> const { jobId } = JSON.parse(res.body); expect(jobId).toBeDefined(); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { @@ -117,7 +122,7 @@ describe.skipIf(!ffmpegAvailable())("merge-videos (requires ffmpeg)", () => { const { jobId } = JSON.parse(res.body); expect(jobId).toBeDefined(); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; error: unknown } | undefined; for (let i = 0; i < 60; i++) { diff --git a/tests/integration/mute-video.test.ts b/tests/integration/tools/video/mute-video.test.ts similarity index 91% rename from tests/integration/mute-video.test.ts rename to tests/integration/tools/video/mute-video.test.ts index ff9da426..93802ee0 100644 --- a/tests/integration/mute-video.test.ts +++ b/tests/integration/tools/video/mute-video.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/replace-audio.test.ts b/tests/integration/tools/video/replace-audio.test.ts similarity index 95% rename from tests/integration/replace-audio.test.ts rename to tests/integration/tools/video/replace-audio.test.ts index 529c1345..edcc7491 100644 --- a/tests/integration/replace-audio.test.ts +++ b/tests/integration/tools/video/replace-audio.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); const MP3 = readFixture(fixtures.audio.tiny("mp3")); diff --git a/tests/integration/resize-video.test.ts b/tests/integration/tools/video/resize-video.test.ts similarity index 91% rename from tests/integration/resize-video.test.ts rename to tests/integration/tools/video/resize-video.test.ts index 0c7e36e4..784da9f5 100644 --- a/tests/integration/resize-video.test.ts +++ b/tests/integration/tools/video/resize-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/reverse-video.test.ts b/tests/integration/tools/video/reverse-video.test.ts similarity index 92% rename from tests/integration/reverse-video.test.ts rename to tests/integration/tools/video/reverse-video.test.ts index 4905abbd..55227e0c 100644 --- a/tests/integration/reverse-video.test.ts +++ b/tests/integration/tools/video/reverse-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/rotate-video.test.ts b/tests/integration/tools/video/rotate-video.test.ts similarity index 92% rename from tests/integration/rotate-video.test.ts rename to tests/integration/tools/video/rotate-video.test.ts index 7d22a589..a3ae7678 100644 --- a/tests/integration/rotate-video.test.ts +++ b/tests/integration/tools/video/rotate-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/stabilize-video.test.ts b/tests/integration/tools/video/stabilize-video.test.ts similarity index 92% rename from tests/integration/stabilize-video.test.ts rename to tests/integration/tools/video/stabilize-video.test.ts index 60e450a7..1043f140 100644 --- a/tests/integration/stabilize-video.test.ts +++ b/tests/integration/tools/video/stabilize-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); @@ -53,7 +58,7 @@ async function resolveResult(res: Awaited>): Promise< const { jobId } = JSON.parse(res.body); expect(jobId).toBeDefined(); - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/trim-video.test.ts b/tests/integration/tools/video/trim-video.test.ts similarity index 93% rename from tests/integration/trim-video.test.ts rename to tests/integration/tools/video/trim-video.test.ts index 59684e8a..76c9a319 100644 --- a/tests/integration/trim-video.test.ts +++ b/tests/integration/tools/video/trim-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/video-color.test.ts b/tests/integration/tools/video/video-color.test.ts similarity index 89% rename from tests/integration/video-color.test.ts rename to tests/integration/tools/video/video-color.test.ts index fa4352e3..3414c337 100644 --- a/tests/integration/video-color.test.ts +++ b/tests/integration/tools/video/video-color.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/video-loudnorm.test.ts b/tests/integration/tools/video/video-loudnorm.test.ts similarity index 93% rename from tests/integration/video-loudnorm.test.ts rename to tests/integration/tools/video/video-loudnorm.test.ts index 0be444ac..4d4c02b1 100644 --- a/tests/integration/video-loudnorm.test.ts +++ b/tests/integration/tools/video/video-loudnorm.test.ts @@ -4,8 +4,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/video-metadata.test.ts b/tests/integration/tools/video/video-metadata.test.ts similarity index 91% rename from tests/integration/video-metadata.test.ts rename to tests/integration/tools/video/video-metadata.test.ts index 1bf32ed0..01c029d1 100644 --- a/tests/integration/video-metadata.test.ts +++ b/tests/integration/tools/video/video-metadata.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/video-speed.test.ts b/tests/integration/tools/video/video-speed.test.ts similarity index 95% rename from tests/integration/video-speed.test.ts rename to tests/integration/tools/video/video-speed.test.ts index e1a6eaec..dee45962 100644 --- a/tests/integration/video-speed.test.ts +++ b/tests/integration/tools/video/video-speed.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/video-to-frames.test.ts b/tests/integration/tools/video/video-to-frames.test.ts similarity index 93% rename from tests/integration/video-to-frames.test.ts rename to tests/integration/tools/video/video-to-frames.test.ts index 104c0d80..68b32749 100644 --- a/tests/integration/video-to-frames.test.ts +++ b/tests/integration/tools/video/video-to-frames.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/video-to-gif.test.ts b/tests/integration/tools/video/video-to-gif.test.ts similarity index 88% rename from tests/integration/video-to-gif.test.ts rename to tests/integration/tools/video/video-to-gif.test.ts index 566ac024..992fb2a3 100644 --- a/tests/integration/video-to-gif.test.ts +++ b/tests/integration/tools/video/video-to-gif.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); @@ -18,7 +23,7 @@ afterAll(async () => { }, 10_000); async function pollJob(jobId: string) { - const { db, schema } = await import("../../apps/api/src/db/index.js"); + const { db, schema } = await import("../../../../apps/api/src/db/index.js"); const { eq } = await import("drizzle-orm"); let row: { status: string; outputRefs: unknown } | undefined; for (let i = 0; i < 120; i++) { diff --git a/tests/integration/video-to-webp.test.ts b/tests/integration/tools/video/video-to-webp.test.ts similarity index 90% rename from tests/integration/video-to-webp.test.ts rename to tests/integration/tools/video/video-to-webp.test.ts index 22250445..4e661428 100644 --- a/tests/integration/video-to-webp.test.ts +++ b/tests/integration/tools/video/video-to-webp.test.ts @@ -1,7 +1,12 @@ import { ffmpegAvailable } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/integration/watermark-video.test.ts b/tests/integration/tools/video/watermark-video.test.ts similarity index 93% rename from tests/integration/watermark-video.test.ts rename to tests/integration/tools/video/watermark-video.test.ts index 9356b1a5..51d93da1 100644 --- a/tests/integration/watermark-video.test.ts +++ b/tests/integration/tools/video/watermark-video.test.ts @@ -3,8 +3,13 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { ffmpegAvailable, probeMedia } from "@snapotter/media-engine"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; -import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; +import { fixtures, readFixture } from "../../../fixtures/index.js"; +import { + buildTestApp, + createMultipartPayload, + loginAsAdmin, + type TestApp, +} from "../../test-server.js"; const MP4 = readFixture(fixtures.video.tiny("mp4")); diff --git a/tests/unit/beautify-backgrounds.test.ts b/tests/unit/api/beautify-backgrounds.test.ts similarity index 98% rename from tests/unit/beautify-backgrounds.test.ts rename to tests/unit/api/beautify-backgrounds.test.ts index 8602b09a..059043c6 100644 --- a/tests/unit/beautify-backgrounds.test.ts +++ b/tests/unit/api/beautify-backgrounds.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from "vitest"; import { generateBackground, getDominantBackground, -} from "../../apps/api/src/lib/beautify/backgrounds.js"; +} from "../../../apps/api/src/lib/beautify/backgrounds.js"; describe("generateBackground", () => { it("generates a solid color background", async () => { diff --git a/tests/unit/beautify-frames.test.ts b/tests/unit/api/beautify-frames.test.ts similarity index 98% rename from tests/unit/beautify-frames.test.ts rename to tests/unit/api/beautify-frames.test.ts index 0a37caba..a6c1bfd1 100644 --- a/tests/unit/beautify-frames.test.ts +++ b/tests/unit/api/beautify-frames.test.ts @@ -1,6 +1,6 @@ import sharp from "sharp"; import { describe, expect, it } from "vitest"; -import { renderFrame } from "../../apps/api/src/lib/beautify/frames.js"; +import { renderFrame } from "../../../apps/api/src/lib/beautify/frames.js"; describe("renderFrame", () => { const makeImage = (w: number, h: number) => diff --git a/tests/unit/beautify-shadow.test.ts b/tests/unit/api/beautify-shadow.test.ts similarity index 96% rename from tests/unit/beautify-shadow.test.ts rename to tests/unit/api/beautify-shadow.test.ts index 68077096..9896213e 100644 --- a/tests/unit/beautify-shadow.test.ts +++ b/tests/unit/api/beautify-shadow.test.ts @@ -1,6 +1,6 @@ import sharp from "sharp"; import { describe, expect, it } from "vitest"; -import { applyShadow } from "../../apps/api/src/lib/beautify/shadow.js"; +import { applyShadow } from "../../../apps/api/src/lib/beautify/shadow.js"; describe("applyShadow", () => { const makeImage = (w: number, h: number) => diff --git a/tests/unit/errors-friendly.test.ts b/tests/unit/api/errors-friendly.test.ts similarity index 97% rename from tests/unit/errors-friendly.test.ts rename to tests/unit/api/errors-friendly.test.ts index d02c4448..e53c995b 100644 --- a/tests/unit/errors-friendly.test.ts +++ b/tests/unit/api/errors-friendly.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { friendlyError } from "../../apps/api/src/lib/errors.js"; +import { friendlyError } from "../../../apps/api/src/lib/errors.js"; const GENERIC = "Processing failed. The file may be in an unsupported or corrupted format."; diff --git a/tests/unit/meme-templates.test.ts b/tests/unit/api/meme-templates.test.ts similarity index 98% rename from tests/unit/meme-templates.test.ts rename to tests/unit/api/meme-templates.test.ts index 1d2571ed..85cc5b80 100644 --- a/tests/unit/meme-templates.test.ts +++ b/tests/unit/api/meme-templates.test.ts @@ -2,7 +2,7 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { describe, expect, it } from "vitest"; -const TEMPLATES_DIR = join(__dirname, "../../apps/api/static/meme-templates"); +const TEMPLATES_DIR = join(__dirname, "../../../apps/api/static/meme-templates"); const MANIFEST_PATH = join(TEMPLATES_DIR, "meme-templates.json"); const VALID_CATEGORIES = ["reaction", "comparison", "opinion", "animals", "classic"]; diff --git a/tests/unit/pdf-to-image.test.ts b/tests/unit/api/pdf-to-image.test.ts similarity index 95% rename from tests/unit/pdf-to-image.test.ts rename to tests/unit/api/pdf-to-image.test.ts index f65c6463..3c945608 100644 --- a/tests/unit/pdf-to-image.test.ts +++ b/tests/unit/api/pdf-to-image.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { parsePageRange } from "../../apps/api/src/routes/tools/pdf-to-image.js"; +import { parsePageRange } from "../../../apps/api/src/routes/tools/pdf-to-image.js"; describe("parsePageRange", () => { it("returns all pages for 'all'", () => { diff --git a/tests/unit/venv-upgrade-stamp.test.ts b/tests/unit/api/venv-upgrade-stamp.test.ts similarity index 100% rename from tests/unit/venv-upgrade-stamp.test.ts rename to tests/unit/api/venv-upgrade-stamp.test.ts diff --git a/tests/unit/auto-enhance.test.ts b/tests/unit/image-engine/auto-enhance.test.ts similarity index 99% rename from tests/unit/auto-enhance.test.ts rename to tests/unit/image-engine/auto-enhance.test.ts index fa1e643f..77aadd98 100644 --- a/tests/unit/auto-enhance.test.ts +++ b/tests/unit/image-engine/auto-enhance.test.ts @@ -1,7 +1,7 @@ import { analyzeImage, applyCorrections, scaleCorrections } from "@snapotter/image-engine"; import sharp from "sharp"; import { describe, expect, it } from "vitest"; -import { fixtures, readFixture } from "../fixtures/index.js"; +import { fixtures, readFixture } from "../../fixtures/index.js"; const PNG_200x150 = readFixture(fixtures.image.base.png200); diff --git a/tests/unit/docker-file-secrets.test.ts b/tests/unit/security/docker-file-secrets.test.ts similarity index 100% rename from tests/unit/docker-file-secrets.test.ts rename to tests/unit/security/docker-file-secrets.test.ts diff --git a/tests/unit/security-auth-hardening.test.ts b/tests/unit/security/security-auth-hardening.test.ts similarity index 96% rename from tests/unit/security-auth-hardening.test.ts rename to tests/unit/security/security-auth-hardening.test.ts index 4d232e62..b5ac0536 100644 --- a/tests/unit/security-auth-hardening.test.ts +++ b/tests/unit/security/security-auth-hardening.test.ts @@ -8,20 +8,20 @@ */ import { describe, expect, it, vi } from "vitest"; -vi.mock("../../apps/api/src/db/index.js", () => ({ +vi.mock("../../../apps/api/src/db/index.js", () => ({ db: {}, pool: {}, closeDb: async () => {}, schema: {}, })); -import { loadEnv } from "../../apps/api/src/lib/env.js"; +import { loadEnv } from "../../../apps/api/src/lib/env.js"; import { changePasswordSchema, loginSchema, registerSchema, resetPasswordSchema, -} from "../../apps/api/src/plugins/auth.js"; +} from "../../../apps/api/src/plugins/auth.js"; // ── Env defaults ───────────────────────────────────────────────────────────── diff --git a/tests/unit/security-error-handling.test.ts b/tests/unit/security/security-error-handling.test.ts similarity index 97% rename from tests/unit/security-error-handling.test.ts rename to tests/unit/security/security-error-handling.test.ts index 338b39dd..0058f15c 100644 --- a/tests/unit/security-error-handling.test.ts +++ b/tests/unit/security/security-error-handling.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { stripInternalPaths } from "../../apps/api/src/lib/errors.js"; +import { stripInternalPaths } from "../../../apps/api/src/lib/errors.js"; describe("stripInternalPaths", () => { it("removes /tmp paths from error messages", () => { diff --git a/tests/unit/security-file-processing.test.ts b/tests/unit/security/security-file-processing.test.ts similarity index 100% rename from tests/unit/security-file-processing.test.ts rename to tests/unit/security/security-file-processing.test.ts diff --git a/tests/unit/security-input-validation.test.ts b/tests/unit/security/security-input-validation.test.ts similarity index 98% rename from tests/unit/security-input-validation.test.ts rename to tests/unit/security/security-input-validation.test.ts index 8079856f..a6ad81ca 100644 --- a/tests/unit/security-input-validation.test.ts +++ b/tests/unit/security/security-input-validation.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from "vitest"; -import { stripInternalPaths } from "../../apps/api/src/lib/errors.js"; +import { stripInternalPaths } from "../../../apps/api/src/lib/errors.js"; import { buildTagArgs, sanitizeTagValue, validateTagName, -} from "../../apps/api/src/lib/exiftool.js"; +} from "../../../apps/api/src/lib/exiftool.js"; describe("ExifTool security: tag value validation", () => { it("rejects tag values exceeding 10,000 characters", () => { diff --git a/tests/unit/security-network.test.ts b/tests/unit/security/security-network.test.ts similarity index 97% rename from tests/unit/security-network.test.ts rename to tests/unit/security/security-network.test.ts index dc0575d7..95fbb57b 100644 --- a/tests/unit/security-network.test.ts +++ b/tests/unit/security/security-network.test.ts @@ -8,8 +8,8 @@ * - CSP directives are present and correctly configured */ import { describe, expect, it } from "vitest"; -import { buildCsp } from "../../apps/api/src/lib/csp.js"; -import { validateFetchUrl } from "../../apps/api/src/lib/ssrf.js"; +import { buildCsp } from "../../../apps/api/src/lib/csp.js"; +import { validateFetchUrl } from "../../../apps/api/src/lib/ssrf.js"; describe("SSRF: blocks private IPv4 addresses", () => { it("blocks 127.0.0.1 (loopback)", async () => { diff --git a/tests/unit/security-rate-limiting.test.ts b/tests/unit/security/security-rate-limiting.test.ts similarity index 100% rename from tests/unit/security-rate-limiting.test.ts rename to tests/unit/security/security-rate-limiting.test.ts diff --git a/tests/unit/security-svg-sanitize.test.ts b/tests/unit/security/security-svg-sanitize.test.ts similarity index 99% rename from tests/unit/security-svg-sanitize.test.ts rename to tests/unit/security/security-svg-sanitize.test.ts index bb3a156a..c55a6e07 100644 --- a/tests/unit/security-svg-sanitize.test.ts +++ b/tests/unit/security/security-svg-sanitize.test.ts @@ -5,7 +5,7 @@ * obfuscation, animation injection, and filter-based SSRF. */ import { describe, expect, it } from "vitest"; -import { sanitizeSvg } from "../../apps/api/src/lib/svg-sanitize.js"; +import { sanitizeSvg } from "../../../apps/api/src/lib/svg-sanitize.js"; /** Wrap a payload fragment inside a minimal valid SVG. */ function wrapSvg(inner: string, attrs = ""): string { diff --git a/tests/unit/analytics-consent-extended.test.ts b/tests/unit/shared/analytics-consent-extended.test.ts similarity index 100% rename from tests/unit/analytics-consent-extended.test.ts rename to tests/unit/shared/analytics-consent-extended.test.ts diff --git a/tests/unit/analytics-consent.test.ts b/tests/unit/shared/analytics-consent.test.ts similarity index 100% rename from tests/unit/analytics-consent.test.ts rename to tests/unit/shared/analytics-consent.test.ts diff --git a/tests/unit/analytics-events.test.ts b/tests/unit/shared/analytics-events.test.ts similarity index 100% rename from tests/unit/analytics-events.test.ts rename to tests/unit/shared/analytics-events.test.ts diff --git a/tests/unit/analytics-types.test.ts b/tests/unit/shared/analytics-types.test.ts similarity index 100% rename from tests/unit/analytics-types.test.ts rename to tests/unit/shared/analytics-types.test.ts diff --git a/tests/unit/features.test.ts b/tests/unit/shared/features.test.ts similarity index 100% rename from tests/unit/features.test.ts rename to tests/unit/shared/features.test.ts diff --git a/tests/unit/pairwise.test.ts b/tests/unit/shared/pairwise.test.ts similarity index 97% rename from tests/unit/pairwise.test.ts rename to tests/unit/shared/pairwise.test.ts index 13351b55..8b167c3a 100644 --- a/tests/unit/pairwise.test.ts +++ b/tests/unit/shared/pairwise.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { pairwise } from "../helpers/pairwise.js"; +import { pairwise } from "../../helpers/pairwise.js"; describe("pairwise covering-array generator", () => { it("covers every pair of values across all axis pairs", () => { diff --git a/tests/unit/pipeline-step-summary.test.ts b/tests/unit/web/pipeline-step-summary.test.ts similarity index 95% rename from tests/unit/pipeline-step-summary.test.ts rename to tests/unit/web/pipeline-step-summary.test.ts index b8cf53c6..d2e2f975 100644 --- a/tests/unit/pipeline-step-summary.test.ts +++ b/tests/unit/web/pipeline-step-summary.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { getSettingsSummary } from "../../apps/web/src/components/tools/pipeline-step-summary"; +import { getSettingsSummary } from "../../../apps/web/src/components/tools/pipeline-step-summary"; describe("getSettingsSummary", () => { it("returns dimensions for resize with width and height", () => { diff --git a/tests/unit/pipeline-store.test.ts b/tests/unit/web/pipeline-store.test.ts similarity index 97% rename from tests/unit/pipeline-store.test.ts rename to tests/unit/web/pipeline-store.test.ts index c9938aa9..b9a1f2b8 100644 --- a/tests/unit/pipeline-store.test.ts +++ b/tests/unit/web/pipeline-store.test.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, it } from "vitest"; -import { usePipelineStore } from "../../apps/web/src/stores/pipeline-store"; +import { usePipelineStore } from "../../../apps/web/src/stores/pipeline-store"; describe("usePipelineStore", () => { afterEach(() => { diff --git a/tests/unit/use-focus-trap.test.ts b/tests/unit/web/use-focus-trap.test.ts similarity index 70% rename from tests/unit/use-focus-trap.test.ts rename to tests/unit/web/use-focus-trap.test.ts index 349d49d5..4ca848d6 100644 --- a/tests/unit/use-focus-trap.test.ts +++ b/tests/unit/web/use-focus-trap.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest"; describe("useFocusTrap", () => { it("should be importable", async () => { - const mod = await import("../../apps/web/src/hooks/use-focus-trap"); + const mod = await import("../../../apps/web/src/hooks/use-focus-trap"); expect(mod.useFocusTrap).toBeDefined(); }); });