Rocky_Mountain_Vending/.pnpm-store/v10/files/b2/3bd4a929ad569135def960102b815a4b0c3847f279482b6fad1fb0f6cec8db511dbea9b7e1adab8887b31b684d5a8df83662b70a7394b54d32e358c28d1cc8
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

35 lines
947 B
Text

import { typanionResolver } from '..';
import { fields, invalidData, isSchema, validData } from './__fixtures__/data';
const tmpObj = {
validate: isSchema,
};
const shouldUseNativeValidation = false;
describe('typanionResolver', () => {
it('should return values from typanionResolver when validation pass', async () => {
const schemaSpy = vi.spyOn(tmpObj, 'validate');
const result = await typanionResolver(schemaSpy as any)(
validData,
undefined,
{
fields,
shouldUseNativeValidation,
},
);
expect(schemaSpy).toHaveBeenCalledTimes(1);
expect(result).toEqual({ errors: {}, values: validData });
});
it('should return a single error from typanionResolver when validation fails', async () => {
const result = await typanionResolver(isSchema)(invalidData, undefined, {
fields,
shouldUseNativeValidation,
});
expect(result).toMatchSnapshot();
});
});