π Description
The marketplace API has several routes β listings/[id]/preflight/route.ts,
listings/[id]/purchase/route.ts, featured/route.ts, and stats/route.ts.
There are tests for listings/route.ts and listings/[id]/route.ts
(route.test.ts) and tests/api/marketplace-purchase.test.ts, but preflight,
featured, and stats lack dedicated coverage.
This issue closes the marketplace API integration-test gaps.
Goal: the preflight, featured, and stats marketplace routes are covered for
success, validation, and error responses.
π― Requirements and Context
- Add integration tests for
listings/[id]/preflight (eligible vs ineligible
buyer, sold-out listing).
- Add tests for
marketplace/featured and marketplace/stats response shapes.
- Reuse
tests/api/helpers.ts request utilities.
- Assert ETag/caching behavior where these routes use it
(marketplace-cache-invalidation.test.ts patterns).
π οΈ Suggested Execution
1. Create a branch
git checkout -b feature/marketplace-api-tests
2. Implement changes
- Add
tests/api/marketplace-preflight.test.ts,
tests/api/marketplace-featured.test.ts, and
tests/api/marketplace-stats.test.ts.
3. Test and commit
- Run
npm test.
- Edge cases: missing listing id, ineligible buyer, empty featured set, stats
with zero listings.
Example commit message
test: cover marketplace preflight, featured, and stats routes
β
Guidelines
- Minimum 95% test coverage on the targeted routes.
- Clear, descriptive test names.
- Timeframe: 96 hours.
π·οΈ Labels
type-testing Β· area-frontend Β· MAYBE REWARDED Β· GRANTFOX OSS Β· OFFICIAL CAMPAIGN
π¬ Community & Support
- Join the CommitLabs contributor Discord: https://discord.gg/WV7tdYkJk
- Introduce yourself before starting to avoid duplicate work.
- Maintainers triage actively and review fast.
π Description
The marketplace API has several routes β
listings/[id]/preflight/route.ts,listings/[id]/purchase/route.ts,featured/route.ts, andstats/route.ts.There are tests for
listings/route.tsandlistings/[id]/route.ts(
route.test.ts) andtests/api/marketplace-purchase.test.ts, but preflight,featured, and stats lack dedicated coverage.
This issue closes the marketplace API integration-test gaps.
π― Requirements and Context
listings/[id]/preflight(eligible vs ineligiblebuyer, sold-out listing).
marketplace/featuredandmarketplace/statsresponse shapes.tests/api/helpers.tsrequest utilities.(
marketplace-cache-invalidation.test.tspatterns).π οΈ Suggested Execution
1. Create a branch
2. Implement changes
tests/api/marketplace-preflight.test.ts,tests/api/marketplace-featured.test.ts, andtests/api/marketplace-stats.test.ts.3. Test and commit
npm test.with zero listings.
Example commit message
β Guidelines
π·οΈ Labels
type-testingΒ·area-frontendΒ·MAYBE REWARDEDΒ·GRANTFOX OSSΒ·OFFICIAL CAMPAIGNπ¬ Community & Support