Skip to content

test(creator): add integration test ensuring max-length (1000) bio preserved#407

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
EmeditWeb:creator-integration-test
Jun 1, 2026
Merged

test(creator): add integration test ensuring max-length (1000) bio preserved#407
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
EmeditWeb:creator-integration-test

Conversation

@EmeditWeb
Copy link
Copy Markdown
Contributor

Close #395

Add integration test for creator detail with max-length bio

Summary

  • Adds an integration test that seeds a creator profile with a 1000-character bio and verifies the GET /api/v1/creators/:creatorId/profile response returns the full bio without truncation or serialization errors.
  • Documents the maximum bio length as the named constant MAX_CREATOR_BIO_LENGTH = 1000 within the test.
  • Uses the handler directly to avoid unnecessary app-level dependencies in the test environment and asserts response shape and headers.

Files changed (summary)

  • Added: creator-detail-long-bio.integration.test.ts
  • Minor update: jest.setup.ts — make test env defaults non-destructive to allow overriding DATABASE_URL during CI/local runs.

Why

  • A creator bio near the maximum allowed length exercises serialization and response handling code paths. This regression test prevents accidental truncation, serialization failures, or response-shape regressions as the codebase evolves.

What I verified locally

  • Installed dependencies and generated Prisma client.
  • Started local Postgres via docker compose up -d postgres.
  • Pushed Prisma schema:
    DATABASE_URL='postgresql://postgres:postgres@localhost:5432/accesslayer' pnpm exec prisma db push
  • Ran the test successfully:
    DATABASE_URL='postgresql://postgres:postgres@localhost:5432/accesslayer' pnpm exec jest creator-detail-long-bio.integration.test.ts --runInBand

Testing Notes / Deployment

  • CI must run the test with a database available (the project uses prisma db push or migrations to create schema). For CI, ensure DATABASE_URL points to the test DB and the DB is provisioned before tests run.
  • The test intentionally uses a 1000-char constant to reflect the Zod schema limit in creator-profile.schemas.ts. If that limit changes, update the test constant to match.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@EmeditWeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit 9c37e83 into accesslayerorg:main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration test for creator detail with very long bio field

2 participants