This commit is contained in:
2025-08-22 14:11:18 -05:00
commit 3e9ca1a146
88 changed files with 14387 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { describe, it, expect } from 'vitest';
import { z } from 'zod';
const schema = z.object({
name: z.string().min(2),
phone: z.string().min(7),
email: z.string().email(),
address: z.string().optional(),
projectType: z.string().min(2),
urgency: z.string().min(2),
description: z.string().min(10)
});
describe('contact schema', () => {
it('accepts valid payload', () => {
const out = schema.safeParse({
name: 'Jane',
phone: '361-555-0000',
email: 'j@x.com',
projectType: 'Residential',
urgency: 'Now',
description: 'Lights out in kitchen'
});
expect(out.success).toBe(true);
});
});

View File

@@ -0,0 +1,7 @@
import { formatPhone } from '@/lib/utils';
import { describe, expect, it } from 'vitest';
describe('formatPhone', () => {
it('formats a raw phone string', () => {
expect(formatPhone('+1 (361) 885-0315')).toBe('(361) 885-0315');
});
});