Rocky_Mountain_Vending/.pnpm-store/v10/files/47/4e83714518334318e96ae5fe86c9ab0987c96602c7fa91d3543290a66fe4ad8ed57f8c10e65e254b288c7c03262fb08d98417baca3a3489996ee27c1cdd4d0
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.1 KiB
Text

import { superstructResolver } from '..';
import { fields, invalidData, schema, validData } from './__fixtures__/data';
const shouldUseNativeValidation = false;
describe('superstructResolver', () => {
it('should return values from superstructResolver when validation pass', async () => {
const result = await superstructResolver(schema)(validData, undefined, {
fields,
shouldUseNativeValidation,
});
expect(result).toEqual({ errors: {}, values: validData });
});
it('should return a single error from superstructResolver when validation fails', async () => {
const result = await superstructResolver(schema)(invalidData, undefined, {
fields,
shouldUseNativeValidation,
});
expect(result).toMatchSnapshot();
});
it('should return values from superstructResolver when validation pass & raw=true', async () => {
const result = await superstructResolver(schema, undefined, { raw: true })(
validData,
undefined,
{
fields,
shouldUseNativeValidation,
},
);
expect(result).toEqual({ errors: {}, values: validData });
});
});