Rocky_Mountain_Vending/.pnpm-store/v10/files/d3/44c19bf68c1ce3d4c30c5257b5d841612dfc541102070ae551c407beeefc9d2ae7a2a293e69b35b0d15780e61fb2b98d6f5fc7d5b51856a33218dc392df446
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

37 lines
1.2 KiB
Text

import { TypeCompiler } from '@sinclair/typebox/compiler';
import { typeboxResolver } from '..';
import { fields, invalidData, schema, validData } from './__fixtures__/data';
const shouldUseNativeValidation = false;
describe('typeboxResolver (with compiler)', () => {
const typecheck = TypeCompiler.Compile(schema);
it('should return a single error from typeboxResolver when validation fails', async () => {
const result = await typeboxResolver(typecheck)(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(typecheck)(invalidData, undefined, {
fields,
criteriaMode: 'all',
shouldUseNativeValidation,
});
expect(result).toMatchSnapshot();
});
it('should validate with success', async () => {
const result = await typeboxResolver(typecheck)(validData, undefined, {
fields,
shouldUseNativeValidation,
});
expect(result).toEqual({ errors: {}, values: validData });
});
});