Rocky_Mountain_Vending/.pnpm-store/v10/files/76/792df5038b9e1921f008df0d3df8a799453ee120a18e2d7e87d5a8d004efe78f1109be7d9553083e76a0999d0428df8f71c239134806f08cad0177fac1e4ad
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

34 lines
1 KiB
Text

import { typeboxResolver } from '..';
import { fields, invalidData, schema, validData } from './__fixtures__/data';
const shouldUseNativeValidation = false;
describe('typeboxResolver', () => {
it('should return a single error from typeboxResolver when validation fails', async () => {
const result = await typeboxResolver(schema)(invalidData, undefined, {
fields,
shouldUseNativeValidation,
});
expect(result).toMatchSnapshot();
});
it('should return all the errors from typeboxResolver when validation fails with `validateAllFieldCriteria` set to true', async () => {
const result = await typeboxResolver(schema)(invalidData, undefined, {
fields,
criteriaMode: 'all',
shouldUseNativeValidation,
});
expect(result).toMatchSnapshot();
});
it('should validate with success', async () => {
const result = await typeboxResolver(schema)(validData, undefined, {
fields,
shouldUseNativeValidation,
});
expect(result).toEqual({ errors: {}, values: validData });
});
});