Skip to content

test(backend): add boundary validation suite for CreateMarketDto (#1280) - #1484

Merged
Olowodarey merged 1 commit into
Arena1X:mainfrom
Francis6-git:test/create-market-dto-validation-issue-1280
Jul 27, 2026
Merged

test(backend): add boundary validation suite for CreateMarketDto (#1280)#1484
Olowodarey merged 1 commit into
Arena1X:mainfrom
Francis6-git:test/create-market-dto-validation-issue-1280

Conversation

@Francis6-git

Copy link
Copy Markdown
Contributor

Description:
Added a dedicated unit test suite (create-market.dto.spec.ts) that invokes class-validator's validate() directly against DTO instances to test all field boundary constraints in isolation.

Changes Made:

  1. New File: backend/src/markets/dto/create-market.dto.spec.ts

  2. Coverage Highlights:

  • Happy Path: Asserts 0 validation errors on fully valid payloads.
  • Title: Verifies minLength, maxLength, isNotEmpty, and isString.
  • Description: Verifies minLength, maxLength, and isString.
  • Category: Verifies isEnum.
  • Outcome Options: Verifies isArray, arrayMinSize (minimum 2), arrayMaxSize (maximum 10), and element string types.
  • Date Validation: Verifies isFutureDate on end_time and isAfterEndTime on resolution_time.
  • Stroops / Stake Bounds: Verifies isNumberString formatting for min/max stake stroop values.
  • Creator Fee: Verifies min (0), max (500), and numeric type constraints.
  • Extra Properties: Documents class-validator behavior regarding un-decorated extra properties.

Closes #1280

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview, Comment Jul 27, 2026 8:26am

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Francis6-git 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

@Olowodarey
Olowodarey merged commit f5da608 into Arena1X:main Jul 27, 2026
5 checks 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.

[Backend] — Test: CreateMarketDto Boundary Validation Not Covered

2 participants