Skip to content

test: add unit spec for IsFutureDate validator - #716

Open
DeFex-lab wants to merge 2 commits into
MergeFi:mainfrom
DeFex-lab:fix/issue-604-common-validators-date-validator-ts-has-no-spec
Open

DeFex-lab wants to merge 2 commits into
MergeFi:mainfrom
DeFex-lab:fix/issue-604-common-validators-date-validator-ts-has-no-spec

Conversation

@DeFex-lab

@DeFex-lab DeFex-lab commented Oct 23, 2026 •

Copy link
Copy Markdown

Overview

This PR adds a unit spec for the IsFutureDate validator in date.validator.ts, which enforces future deadlines (#108, #171). The validator previously had no test coverage.

Related Issue

Closes #[issue number]

Changes

🧪 Validator Tests

  • [ADD] Unit spec covering IsFutureDate behavior:
    • Past date → rejected
    • Current time ("now") → rejected
    • Future date → accepted
    • Invalid date string → rejected
    • Non-string input → rejected

Verification Results

Tests were added for the validator behavior listed above. Run with:

npm test -- src/common/validators/date.validator.spec.ts
Acceptance Criteria Status
Spec covers past, now and future dates ✅ Added
Spec covers an invalid string and a non-string ✅ Added
Spec file sits beside date.validator.ts ✅ Added

Closes #604

@vercel

vercel Bot commented Oct 23, 2026

Copy link
Copy Markdown

@DeFex-lab is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

common/validators/date.validator.ts has no spec file

1 participant