Skip to content

Database fixtures#406

Merged
Chucks1093 merged 5 commits into
accesslayerorg:mainfrom
shadrach68:databaseFixtures
Jun 1, 2026
Merged

Database fixtures#406
Chucks1093 merged 5 commits into
accesslayerorg:mainfrom
shadrach68:databaseFixtures

Conversation

@shadrach68
Copy link
Copy Markdown
Contributor

closes #396

Summary

Test fixtures using randomized data can produce non-deterministic results that are hard to debug when tests fail. This PR introduces a new fixture helper that generates stable, deterministic creator records from a seed value, making failures reproducible and easier to investigate.

Changes

  • New Helper: Added createSeededCreatorFixture to generate stable test database fixtures.
  • Documentation: Documented the exact mapping from seed to generated field values via JSDoc in the helper.
  • Helper Tests: Added comprehensive unit tests to ensure that the same seed produces the same record, and different seeds produce distinct records.
  • Test Refactoring: Refactored inline and randomized fixtures in creator.service.test.ts and creator-list-item.mapper.test.ts to use the new seeded helper.

Acceptance Criteria

  • The same seed value always produces the same fixture record
  • Different seed values produce distinct records
  • At least two existing tests are updated to use the helper

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@shadrach68 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 7968276 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 helper for generating stable test database fixtures from seed values

2 participants