"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const string_js_1 = require("./string.js");
(0, vitest_1.describe)('camel case to display', () => {
    (0, vitest_1.test)('can convert camel case to display', () => {
        (0, vitest_1.expect)((0, string_js_1.camelCaseToDisplay)('testCamelCase')).toBe('Test Camel Case');
    });
});
(0, vitest_1.describe)('validate email', () => {
    (0, vitest_1.test)('can validate email', () => {
        (0, vitest_1.expect)((0, string_js_1.validateEmail)('somebody@domain.com')).toBe(true);
        (0, vitest_1.expect)((0, string_js_1.validateEmail)('somebody+test@domain.com')).toBe(true);
        (0, vitest_1.expect)((0, string_js_1.validateEmail)('some-body_123@domain.com')).toBe(true);
        (0, vitest_1.expect)((0, string_js_1.validateEmail)('somebody@domain.another.com')).toBe(true);
        (0, vitest_1.expect)((0, string_js_1.validateEmail)('somebody@place@domain.com')).toBe(false);
        (0, vitest_1.expect)((0, string_js_1.validateEmail)('some<>body@domain.com')).toBe(false);
    });
});
(0, vitest_1.describe)('isUuid', () => {
    (0, vitest_1.test)('accepts canonical RFC 4122-style UUIDs (case-insensitive)', () => {
        (0, vitest_1.expect)((0, string_js_1.isUuid)('a1b2c3d4-e5f6-7890-abcd-1234567890ab')).toBe(true);
        (0, vitest_1.expect)((0, string_js_1.isUuid)('A1B2C3D4-E5F6-7890-ABCD-1234567890AB')).toBe(true);
        (0, vitest_1.expect)((0, string_js_1.isUuid)('00000000-0000-0000-0000-000000000000')).toBe(true);
    });
    (0, vitest_1.test)('rejects non-UUID strings without throwing', () => {
        // Strictness is the contract — these are the shapes PostgreSQL would
        // reject with `invalid input syntax for type uuid` if forwarded to a
        // UUID column.
        (0, vitest_1.expect)((0, string_js_1.isUuid)('not-a-uuid')).toBe(false);
        (0, vitest_1.expect)((0, string_js_1.isUuid)('unknown agent id')).toBe(false);
        // Near-miss: first segment is 7 chars instead of 8.
        (0, vitest_1.expect)((0, string_js_1.isUuid)('1234567-1234-1234-1234-123456789abc')).toBe(false);
        // Too many segments.
        (0, vitest_1.expect)((0, string_js_1.isUuid)('a1b2c3d4-e5f6-7890-abcd-1234567890ab-extra')).toBe(false);
        // Non-hex character.
        (0, vitest_1.expect)((0, string_js_1.isUuid)('a1b2c3d4-e5f6-7890-abcd-1234567890zz')).toBe(false);
        // Empty string.
        (0, vitest_1.expect)((0, string_js_1.isUuid)('')).toBe(false);
    });
    (0, vitest_1.test)('rejects non-string inputs', () => {
        (0, vitest_1.expect)((0, string_js_1.isUuid)(null)).toBe(false);
        (0, vitest_1.expect)((0, string_js_1.isUuid)(undefined)).toBe(false);
        (0, vitest_1.expect)((0, string_js_1.isUuid)(123)).toBe(false);
        (0, vitest_1.expect)((0, string_js_1.isUuid)({})).toBe(false);
    });
});
(0, vitest_1.describe)('getNextEntityName', () => {
    (0, vitest_1.test)('get next name with underscore', async () => {
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs_', ['Tabs_1', 'Tabs_2', 'Tabs_3'])).toEqual('Tabs_4');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs_', ['Tabs_1', 'Tabs_2', 'Tabs_5'])).toEqual('Tabs_6');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs_', [])).toEqual('Tabs_1');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs_', ['Tabs_____1', 'Tabs__2', 'Tabs___3'])).toEqual('Tabs_4');
    });
    (0, vitest_1.test)('get next name with space', async () => {
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs ', ['Tabs 1', 'Tabs 2', 'Tabs 3'], ' ')).toEqual('Tabs 4');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs ', ['Tabs 1', 'Tabs 2', 'Tabs 5'], ' ')).toEqual('Tabs 6');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs ', [], ' ')).toEqual('Tabs 1');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs ', ['Tabs     1', 'Tabs  2', 'Tabs   3'], ' ')).toEqual('Tabs 4');
        (0, vitest_1.expect)((0, string_js_1.getNextEntityName)('Tabs ', ['Tabs 1', 'Tabs 2      ', 'Tabs 3  '], ' ')).toEqual('Tabs 4');
    });
});
//# sourceMappingURL=string.test.js.map