Test Coverage
Verified snapshot:634Vitest cases (634 passed,0 skipped) and93Playwright executions (31specs x3browsers). Playwright static skip directives remain blocked inapps/terra/tests.
Summary
| Area | Current state | Notes |
|---|---|---|
| Unit + Integration (Vitest) | 634 passing, 0 skipped | Duplicate-form and notification trend suites are now active and stable |
| E2E policy | Enforced | check-terra-skipped-tests.mjs blocks test.skip/describe.skip/it.skip in Terra Playwright specs |
| E2E inventory | 31 specs x 3 browsers | 93 total listed runs in current Playwright config |
| CI hard gates | Enabled | CI enforces no-skipped Playwright specs and runs Chromium status smoke tests |
Auth & Permissions (71 cases)
Auth Guards — 25 cases
Auth Guards — 25 cases
src/lib/__tests__/auth-guards.test.tsrequireAdmin, requireSuperAdmin, requireFormAccess, requireFormViewAccess and their result-based variants (checkAdmin, checkFormAccess), plus withAdminAuth / withFormAuth wrapper decorators. Proves missing sessions, wrong roles, and nonexistent forms are all caught.Team Permissions — 12 cases
Team Permissions — 12 cases
src/app/actions/__tests__/team-permissions.test.tscanEditForm, canViewForm, canManageTeam. Proves the critical invariant: global viewer overrides form owner. Also covers migration backwards compat and global editor override.Permission System — 28 cases
Permission System — 28 cases
src/app/actions/__tests__/permissions.test.tsisSuperAdmin, getUserFormRole, cross-form access denial, privilege escalation prevention, last-owner protection, scope enforcement.Submission Management — 3 cases
Submission Management — 3 cases
src/app/actions/__tests__/submission-management.test.tsSystem Auth — 3 cases
System Auth — 3 cases
src/app/actions/__tests__/system-auth.test.tsData Protection (61 cases)
Encryption — 32 cases
Encryption — 32 cases
src/lib/__tests__/encryption.test.tsAudit Logging — 29 cases
Audit Logging — 29 cases
src/lib/__tests__/audit.test.tsInput Validation (123 cases)
Security Utilities — 72 cases
Security Utilities — 72 cases
src/lib/__tests__/security.test.tsFile Operations — 15 cases
File Operations — 15 cases
src/app/actions/__tests__/files-security.test.tsImport Security — 11 cases
Import Security — 11 cases
src/app/actions/__tests__/import-security.test.tsRate Limiting — 25 cases
Rate Limiting — 25 cases
src/lib/__tests__/rate-limit.test.tsIntegrations (66 cases)
Webhooks — 29 cases
Webhooks — 29 cases
src/app/actions/__tests__/webhooks.test.ts + src/lib/__tests__/webhook-security.test.tsAirtable Sync — 16 cases
Airtable Sync — 16 cases
src/app/actions/__tests__/airtable-status-sync.test.tsAsync Queue — 21 cases
Async Queue — 21 cases
src/lib/__tests__/async-queue.test.tsNotifications (35 cases)
Notification Events — 35 cases (running)
Notification Events — 35 cases (running)
src/app/actions/__tests__/notifications.test.tsProvider Tests — 7 cases
Provider Tests — 7 cases
src/app/actions/__tests__/notification-test.test.tsAdmin-only enforcement, missing config handling, provider status.Form Settings — 6 cases
Form Settings — 6 cases
src/app/actions/__tests__/form-notification-settings.test.tsAuth enforcement, get/save settings, insert vs update path, null handling.Form Engine (95 cases)
Form Renderer — 10 cases
Form Renderer — 10 cases
src/components/engine/__tests__/form-renderer.test.tsxRenderer — 15 cases
Renderer — 15 cases
src/components/engine/renderer.test.tsxField Key Generation — 26 cases
Field Key Generation — 26 cases
src/lib/__tests__/field-key.test.tsText Field — 13 cases
Text Field — 13 cases
src/components/engine/fields/__tests__/text-field.test.tsxText input rendering, validation, placeholder behavior, character limits, input masking.Choice Field — 11 cases
Choice Field — 11 cases
src/components/engine/fields/__tests__/choice-field.test.tsxRadio/checkbox/dropdown rendering, selection behavior, multi-select, “other” option handling.Form Submission Integration — 10 cases
Form Submission Integration — 10 cases
src/components/engine/__tests__/form-submission-integration.test.tsxEnd-to-end form fill and submit flow, validation errors, success confirmation.Form Duplication — 10 cases (running)
Form Duplication — 10 cases (running)
src/app/actions/__tests__/duplicate-form.test.tsCovers copy schema behavior, draft reset, unique slug generation, branding/language copy, and alert/domain stripping with stable Supabase mocks.Form Import (50 cases)
HTML Extractor — 10 cases
HTML Extractor — 10 cases
src/lib/form-import/__tests__/html-extractor.test.tsExtracts text/email inputs, select/dropdown fields, textareas. Skips hidden inputs and submit buttons.Element Validation — 16 cases
Element Validation — 16 cases
src/lib/form-import/__tests__/element-validation.test.tsValidates extracted form elements: required fields, types, labels, options, nested structures.JSON Extraction — 12 cases
JSON Extraction — 12 cases
src/lib/form-import/__tests__/json-extraction.test.tsParses AI-generated JSON into form schema, handles malformed input, edge cases.PDF Processing — 7 cases
PDF Processing — 7 cases
src/lib/form-import/__tests__/pdf-normalization.test.ts (6 cases)
src/lib/form-import/__tests__/pdf-preprocessor.test.ts (1 case)PDF text extraction, normalization, layout detection.Image Import & Metrics — 5 cases
Image Import & Metrics — 5 cases
src/lib/form-import/__tests__/image-import.test.ts (1 case)
src/lib/form-import/__tests__/import-metrics.test.ts (2 cases)
src/lib/form-import/__tests__/import-review.test.ts (2 cases)Image-to-form conversion, import quality metrics, review workflow.E2E Tests (31 specs, 93 browser executions)
test.skip/describe.skip. CI
blocks new skipped directives and runs public status smoke checks in Chromium.Status Lookup — 19 cases (running)
Status Lookup — 19 cases (running)
tests/status-lookup.spec.tsPage loads, heading visible, search form present, empty submit blocked, uppercase input accepted, validation flows.Form Submission — deterministic fixture handling
Form Submission — deterministic fixture handling
tests/submission.spec.tsValidation errors on empty form and successful submit flow. CI fails fast when required fixtures are missing; local runs can opt into explicit fixture bypass for exploratory work.Example — 2 cases (running)
Example — 2 cases (running)
tests/example.spec.tsPlaywright default example tests.