You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add unit tests for the validation functions and Zod schemas in src/lib/utils/validation.ts.
Why
Validation functions are critical for data integrity across forms (profile updates, quiz submissions, reward claims). Without tests, regressions in validation logic could allow invalid data through or reject valid input.
Scope
Create src/lib/utils/__tests__/validation.test.ts
Test all exported validators and Zod schemas
No source code changes
Acceptance Criteria
Tests for isValidStellarAddress (valid, wrong length, wrong prefix, invalid checksum)
Tests for isValidEd25519PublicKey (valid, invalid)
Tests for isValidContractId (valid, invalid)
Tests for required, minLength, maxLength, displayName, composeValidators
Tests for Zod schemas: profileUpdateSchema, courseCreateSchema, quizSubmitSchema, rewardClaimSchema
What
Add unit tests for the validation functions and Zod schemas in
src/lib/utils/validation.ts.Why
Validation functions are critical for data integrity across forms (profile updates, quiz submissions, reward claims). Without tests, regressions in validation logic could allow invalid data through or reject valid input.
Scope
src/lib/utils/__tests__/validation.test.tsAcceptance Criteria
isValidStellarAddress(valid, wrong length, wrong prefix, invalid checksum)isValidEd25519PublicKey(valid, invalid)isValidContractId(valid, invalid)required,minLength,maxLength,displayName,composeValidatorsprofileUpdateSchema,courseCreateSchema,quizSubmitSchema,rewardClaimSchemanpm testpassesTechnical Context
File:
src/lib/utils/validation.tsExports:
isValidStellarAddress,isValidEd25519PublicKey,isValidContractId,required,minLength,maxLength,stellarAddress,displayName,composeValidatorsprofileUpdateSchema,courseCreateSchema,quizSubmitSchema,rewardClaimSchemaLabels: tests