import { describe, expect, it } from 'vitest';
import { pagePathField, slugField } from '../presets.js';
describe('pagePathField', () => {
    it('returns a single optional `path` text field with sensible defaults', () => {
        const field = pagePathField();
        expect(Object.keys(field)).toEqual(['path']);
        const path = field.path;
        expect(path.label).toBe('Path');
        expect(path.required).toBe(false);
        expect(path.admin?.description).toMatch(/path/i);
        // Narrow to the TextField member to assert text-specific constraints.
        if (path.type !== 'text')
            throw new Error('expected a text field');
        expect(path.maxLength).toBe(512);
    });
    it('honors label + required overrides', () => {
        const field = pagePathField({ label: 'URL Path', required: true });
        expect(field.path.label).toBe('URL Path');
        expect(field.path.required).toBe(true);
    });
    it('is distinct from the slug field (different key + type)', () => {
        const path = pagePathField();
        const slug = slugField();
        expect(Object.keys(path)).not.toEqual(Object.keys(slug));
        expect(path.path.type).toBe('text');
        expect(slug.slug.type).toBe('slug');
    });
});
//# sourceMappingURL=presets.test.js.map