Plan: E2E Manifest Integration

On this page

Status

COMPLETE

Context

The craig-seed generator is complete (commit 295cb45) and produces deterministic SQL plus an optional TypeScript manifest via --manifest. However, the 71 E2E tests still reference a hand-crafted tests/e2e/lib/seed.ts with hardcoded UUIDs from the old static SQL files (now deleted). The E2E tests will fail against generated data because the key names, entity values, and data structure differ.

This plan wires the auto-generated manifest into the E2E tests, pins the seed for reproducibility, and establishes the feature-branch workflow.

Branch

feature/e2e-manifest-integration (from main)

Steps

Step 1: Enhance Manifest Generator

File: tools/craig-seed/src/manifest.rs

Add fields the E2E tests need for cross-referencing:

  • ICPC requests: add childId (model has child_id — tests need this to look up the child on the ICPC detail page)

  • Placements: add caseId, childId (for creating placements and verifying linkage)

  • Agreements: add partnerId (for navigating from agreement to partner)

  • Court orders: add to manifest (not currently emitted) — add courtOrders section with id, caseId, orderType

  • Contacts: add caseId so tests can find a contact belonging to a specific case

Step 2: Pin Seed & Bump Families

With 9 families, entity counts are borderline for pagination tests (need >10 referrals at per_page=10). Bump to 12 families for comfortable margins.

docker-compose.yml:

CRAIG_SEED: ${CRAIG_SEED:-42}
CRAIG_FAMILIES: ${CRAIG_FAMILIES:-12}

.gitlab-ci.yml: Add to integration-test and e2e-test job variables:

CRAIG_SEED: "42"
CRAIG_FAMILIES: "12"

Step 3: Generate & Inspect Manifest

cargo run -p craig-seed -- --seed 42 --families 12 --output-dir /tmp/seed --manifest tests/e2e/lib/seed.ts

Verify minimum counts:

  • Referrals > 10 (pagination)

  • Cases >= 3 per worker=all, at least 1 per worker

  • Investigations >= 2

  • At least 1 draft case plan + 1 active case plan

  • At least 1 foster home, 1 exchange partner, 1 ICPC request

If counts are insufficient, bump to --families 15.

Step 4: Update E2E Spec Files

The generated manifest uses indexed naming (case0_fulton, ref0_fulton, inv0, home0_fulton, partner0, icpc0, plan0) instead of old semantic names. Person keys already use camelCase(first, last).

Spec files to update: cases.spec.ts (~15 refs), intake.spec.ts (~6), placement.spec.ts (~4), exchange.spec.ts (~4), navigation.spec.ts (~2), bobsmith.spec.ts (~2), pagination.spec.ts (comments).

No changes needed: auth.spec.ts, setup.ts, dashboard.spec.ts, dashboard-admin.spec.ts, rules.spec.ts, rbac.spec.ts, error-paths.spec.ts.

Step 5: Verify

cargo test -p craig-seed --locked
cargo xtask dev restart
cargo xtask e2e

Files Modified

File Change

tools/craig-seed/src/manifest.rs

Add childId, caseId, partnerId, courtOrders section, caseId on contacts

docker-compose.yml

Pin CRAIG_SEED=42, CRAIG_FAMILIES=12

.gitlab-ci.yml

Pin seed in integration-test and e2e-test jobs

tests/e2e/lib/seed.ts

Replaced with auto-generated manifest

tests/e2e/specs/*.spec.ts

7 spec files: remap SEED references to indexed keys

Seed Attachments (Deferred)

Sample PDFs/images for attachment testing is a separate concern. Will be a follow-up feature branch after this one is merged.

Edit this page · latest