Add integration tests and improvements for creator endpoints#371
Merged
Chucks1093 merged 1 commit intoMay 30, 2026
Merged
Conversation
- Add integration test for creator list sort stability with duplicate values - Add helper for safely reading nested optional fields from responses - Add structured debug logs for cache eviction events - Add integration test for Content-Type header validation on creator routes Closes accesslayerorg#366 Closes accesslayerorg#365 Closes accesslayerorg#367 Closes accesslayerorg#344
|
@Georgechisom 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses four issues related to creator endpoints by adding integration tests and utility improvements to enhance stability, maintainability, and observability.
Changes
Integration Test for Sort Stability (Issue #366)
Added integration test to verify that creator list responses maintain stable ordering when multiple creators share identical sort field values. The test confirms that a tie-breaker field (id) is consistently applied to prevent undefined ordering across repeated requests.
Files:
src/modules/creators/creator-list-sort-stability.integration.test.tsSafe Nested Field Reader Helper (Issue #365)
Implemented a utility helper for safely reading nested optional fields from creator response objects. This reduces boilerplate null checks and prevents null reference errors throughout the codebase.
Files:
src/utils/safe-nested-read.utils.tssrc/utils/safe-nested-read.utils.test.tssrc/modules/creators/creator-list-item.mapper.ts(applied helper)src/modules/creators/creators.serializers.ts(applied helper)Structured Cache Eviction Logs (Issue #367)
Added debug-level structured logging for cache eviction events on creator endpoints. Logs include cache key and eviction reason (expired, stale, or overflow) to help operators understand cache churn and tune TTLs.
Files:
src/modules/creators/creators.cache.tsContent-Type Header Integration Test (Issue #344)
Added integration tests to verify that creator route responses always include the correct Content-Type header. This prevents regressions when middleware or serialization changes are made.
Files:
src/modules/creators/creator-route-content-type.integration.test.tssrc/utils/api-response.utils.ts(ensured Content-Type is set)Testing
All new tests pass successfully:
Ran test command:
Acceptance Criteria
All acceptance criteria from the issues have been met:
Closes #366
Closes #365
Closes #367
Closes #344