"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const profiles_js_1 = require("./profiles.js");
(0, vitest_1.describe)('AVAILABLE_STYLES', () => {
    (0, vitest_1.it)('should contain all 9 styles including custom', () => {
        (0, vitest_1.expect)(profiles_js_1.AVAILABLE_STYLES).toHaveLength(9);
        (0, vitest_1.expect)(profiles_js_1.AVAILABLE_STYLES).toContain('custom');
    });
    (0, vitest_1.it)('should contain all 8 preset styles', () => {
        const presets = [
            'tipik_turk_kizi', 'tripli', 'alingan', 'neseli',
            'gizemli', 'soguk', 'ilgili', 'oyuncu',
        ];
        for (const style of presets) {
            (0, vitest_1.expect)(profiles_js_1.AVAILABLE_STYLES).toContain(style);
        }
    });
});
(0, vitest_1.describe)('PRESET_PROFILES', () => {
    (0, vitest_1.it)('should have all 8 preset profiles', () => {
        (0, vitest_1.expect)(Object.keys(profiles_js_1.PRESET_PROFILES)).toHaveLength(8);
    });
    (0, vitest_1.it)('each profile should have required toneOfVoice fields', () => {
        for (const [, profile] of Object.entries(profiles_js_1.PRESET_PROFILES)) {
            (0, vitest_1.expect)(profile.toneOfVoice).toBeDefined();
            (0, vitest_1.expect)(['casual', 'semi-formal']).toContain(profile.toneOfVoice.formality);
            (0, vitest_1.expect)(['low', 'medium', 'high']).toContain(profile.toneOfVoice.emoji_frequency);
            (0, vitest_1.expect)(['short', 'medium', 'long']).toContain(profile.toneOfVoice.message_length);
            (0, vitest_1.expect)(['none', 'subtle', 'frequent']).toContain(profile.toneOfVoice.humor_level);
            (0, vitest_1.expect)(['none', 'subtle', 'moderate', 'high']).toContain(profile.toneOfVoice.flirtation_level);
        }
    });
    (0, vitest_1.it)('each profile should have non-empty language patterns', () => {
        for (const [, profile] of Object.entries(profiles_js_1.PRESET_PROFILES)) {
            (0, vitest_1.expect)(profile.languagePatterns.common_phrases.length).toBeGreaterThan(0);
            (0, vitest_1.expect)(profile.languagePatterns.filler_words.length).toBeGreaterThan(0);
            (0, vitest_1.expect)(Object.keys(profile.languagePatterns.reaction_templates).length).toBeGreaterThan(0);
        }
    });
    (0, vitest_1.it)('each profile should have valid salesBehavior', () => {
        for (const [, profile] of Object.entries(profiles_js_1.PRESET_PROFILES)) {
            (0, vitest_1.expect)(profile.salesBehavior.min_messages_before_pitch).toBeGreaterThan(0);
            (0, vitest_1.expect)(profile.salesBehavior.cooldown_minutes).toBeGreaterThan(0);
            (0, vitest_1.expect)(['subtle', 'playful', 'direct']).toContain(profile.salesBehavior.pitch_style);
        }
    });
    (0, vitest_1.it)('each profile should have reaction templates for common emotions', () => {
        const emotions = ['happy', 'sad', 'angry', 'surprised', 'flirt'];
        for (const [, profile] of Object.entries(profiles_js_1.PRESET_PROFILES)) {
            for (const emotion of emotions) {
                (0, vitest_1.expect)(profile.languagePatterns.reaction_templates[emotion]).toBeDefined();
                (0, vitest_1.expect)(profile.languagePatterns.reaction_templates[emotion].length).toBeGreaterThan(0);
            }
        }
    });
});
(0, vitest_1.describe)('getProfile', () => {
    (0, vitest_1.it)('should return a profile with the given characterId for a preset style', () => {
        const profile = (0, profiles_js_1.getProfile)('neseli', 'char-123');
        (0, vitest_1.expect)(profile.characterId).toBe('char-123');
        (0, vitest_1.expect)(profile.style).toBe('neseli');
    });
    (0, vitest_1.it)('should return a deep clone (no shared references with preset)', () => {
        const p1 = (0, profiles_js_1.getProfile)('tripli', 'a');
        const p2 = (0, profiles_js_1.getProfile)('tripli', 'b');
        p1.languagePatterns.common_phrases.push('test');
        (0, vitest_1.expect)(p2.languagePatterns.common_phrases).not.toContain('test');
    });
    (0, vitest_1.it)('should return a custom profile with customStyleDescription', () => {
        const profile = (0, profiles_js_1.getProfile)('custom', 'char-456', 'Çok romantik ve şiirsel konuşan biri');
        (0, vitest_1.expect)(profile.style).toBe('custom');
        (0, vitest_1.expect)(profile.characterId).toBe('char-456');
        (0, vitest_1.expect)(profile.customStyleDescription).toBe('Çok romantik ve şiirsel konuşan biri');
    });
    (0, vitest_1.it)('should default customStyleDescription to empty string when not provided', () => {
        const profile = (0, profiles_js_1.getProfile)('custom', 'char-789');
        (0, vitest_1.expect)(profile.customStyleDescription).toBe('');
    });
    (0, vitest_1.it)('should not include customStyleDescription for preset styles', () => {
        const profile = (0, profiles_js_1.getProfile)('soguk', 'char-abc');
        (0, vitest_1.expect)(profile.customStyleDescription).toBeUndefined();
    });
    (0, vitest_1.it)('should throw for an unknown style', () => {
        (0, vitest_1.expect)(() => (0, profiles_js_1.getProfile)('nonexistent', 'x')).toThrow('Unknown conversation style');
    });
    (0, vitest_1.it)('should return all 8 preset styles without error', () => {
        const presets = [
            'tipik_turk_kizi', 'tripli', 'alingan', 'neseli',
            'gizemli', 'soguk', 'ilgili', 'oyuncu',
        ];
        for (const style of presets) {
            const profile = (0, profiles_js_1.getProfile)(style, `char-${style}`);
            (0, vitest_1.expect)(profile.characterId).toBe(`char-${style}`);
            (0, vitest_1.expect)(profile.style).toBe(style);
        }
    });
});
//# sourceMappingURL=profiles.test.js.map