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>
26 lines
800 B
Text
26 lines
800 B
Text
import { arktypeResolver } from '..';
|
|
import { fields, invalidData, schema, validData } from './__fixtures__/data';
|
|
|
|
const shouldUseNativeValidation = false;
|
|
|
|
describe('arktypeResolver', () => {
|
|
it('should return values from arktypeResolver when validation pass & raw=true', async () => {
|
|
const result = await arktypeResolver(schema, undefined, {
|
|
raw: true,
|
|
})(validData, undefined, {
|
|
fields,
|
|
shouldUseNativeValidation,
|
|
});
|
|
|
|
expect(result).toEqual({ errors: {}, values: validData });
|
|
});
|
|
|
|
it('should return a single error from arktypeResolver when validation fails', async () => {
|
|
const result = await arktypeResolver(schema)(invalidData, undefined, {
|
|
fields,
|
|
shouldUseNativeValidation,
|
|
});
|
|
|
|
expect(result).toMatchSnapshot();
|
|
});
|
|
});
|