"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const prompt_builder_js_1 = require("./prompt-builder.js");
function makeDNA(overrides) {
    return {
        id: 'test-char-1',
        createdAt: '2025-01-01T00:00:00Z',
        updatedAt: '2025-01-01T00:00:00Z',
        status: 'active',
        identity: { name: 'Aylin', age: 24, nationality: 'Turkish', city: 'Istanbul', occupation: 'model', personality_tags: ['fun', 'outgoing'], mbti: 'ENFP', backstory: 'A vibrant model from Istanbul' },
        physicalMeasurements: { height_cm: 172, weight_kg: 56, body_type: 'slim', measurements: { bust: 88, waist: 62, hips: 90 } },
        skinMap: { base: '#F5D0A9', shadow: '#D4A574', highlight: '#FFE4C4' },
        faceAnatomy: { eye_shape: 'almond', eye_color: '#8B4513', eyebrow_shape: 'arched', nose_type: 'straight', lip_shape: 'full', cheekbones: 'high', jawline: 'soft', distinctive_marks: ['beauty mark on left cheek'] },
        hairDNA: { style: 'wavy', length: 'long', texture: 'silky', root_color: '#3B2F2F', mid_color: '#5C4033', highlight_color: '#8B6914' },
        bodyBiometrics: { body_type_detail: 'hourglass', posture: 'upright', skin_texture: 'smooth' },
        profileView: { best_angle: 'left-45', signature_pose: 'hand-on-hip' },
        expressionMotion: { default_expression: 'smile', smile_type: 'warm', gaze_style: 'direct' },
        makeupStyle: { philosophy: 'natural', skin_finish: 'dewy', colors: { primary: '#C48793', secondary: '#E8B4B8', accent: '#8B0000' } },
        fashionStyle: { aesthetic: 'casual-chic', main_colors: ['#000000', '#FFFFFF'], signature_pieces: ['jeans', 'crop top'] },
        technicalSettings: { camera_body: 'Canon R5', portrait_lens: '85mm f/1.4', full_body_lens: '35mm f/1.4', film_stock: 'Portra 400' },
        ...overrides,
    };
}
(0, vitest_1.describe)('buildSubjectDescription', () => {
    (0, vitest_1.it)('should include physical features from DNA', () => {
        const dna = makeDNA();
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).toContain('24 year old');
        (0, vitest_1.expect)(subject).toContain('Turkish');
        (0, vitest_1.expect)(subject).toContain('172cm tall');
        (0, vitest_1.expect)(subject).toContain('slim');
        (0, vitest_1.expect)(subject).toContain('hourglass');
    });
    (0, vitest_1.it)('should include skin HEX colors', () => {
        const dna = makeDNA();
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).toContain('#F5D0A9');
        (0, vitest_1.expect)(subject).toContain('#D4A574');
        (0, vitest_1.expect)(subject).toContain('#FFE4C4');
    });
    (0, vitest_1.it)('should include hair details with HEX colors', () => {
        const dna = makeDNA();
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).toContain('long');
        (0, vitest_1.expect)(subject).toContain('silky');
        (0, vitest_1.expect)(subject).toContain('wavy');
        (0, vitest_1.expect)(subject).toContain('#3B2F2F');
        (0, vitest_1.expect)(subject).toContain('#5C4033');
        (0, vitest_1.expect)(subject).toContain('#8B6914');
    });
    (0, vitest_1.it)('should include face anatomy details', () => {
        const dna = makeDNA();
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).toContain('almond');
        (0, vitest_1.expect)(subject).toContain('#8B4513');
        (0, vitest_1.expect)(subject).toContain('arched');
        (0, vitest_1.expect)(subject).toContain('straight nose');
        (0, vitest_1.expect)(subject).toContain('full lips');
        (0, vitest_1.expect)(subject).toContain('high cheekbones');
        (0, vitest_1.expect)(subject).toContain('soft jawline');
    });
    (0, vitest_1.it)('should include distinctive marks when present', () => {
        const dna = makeDNA();
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).toContain('beauty mark on left cheek');
    });
    (0, vitest_1.it)('should omit distinctive marks section when empty', () => {
        const dna = makeDNA({
            faceAnatomy: { eye_shape: 'round', eye_color: '#000', eyebrow_shape: 'flat', nose_type: 'button', lip_shape: 'thin', cheekbones: 'low', jawline: 'sharp', distinctive_marks: [] },
        });
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).not.toContain('distinctive marks');
    });
    (0, vitest_1.it)('should include expression and gaze', () => {
        const dna = makeDNA();
        const subject = (0, prompt_builder_js_1.buildSubjectDescription)(dna);
        (0, vitest_1.expect)(subject).toContain('smile expression');
        (0, vitest_1.expect)(subject).toContain('warm smile');
        (0, vitest_1.expect)(subject).toContain('direct gaze');
    });
});
(0, vitest_1.describe)('buildCameraSettings', () => {
    (0, vitest_1.it)('should include all technical settings', () => {
        const dna = makeDNA();
        const camera = (0, prompt_builder_js_1.buildCameraSettings)(dna);
        (0, vitest_1.expect)(camera).toContain('Canon R5');
        (0, vitest_1.expect)(camera).toContain('85mm f/1.4');
        (0, vitest_1.expect)(camera).toContain('35mm f/1.4');
        (0, vitest_1.expect)(camera).toContain('Portra 400');
    });
    (0, vitest_1.it)('should format as shot on camera with lens and film stock', () => {
        const dna = makeDNA();
        const camera = (0, prompt_builder_js_1.buildCameraSettings)(dna);
        (0, vitest_1.expect)(camera).toMatch(/^shot on /);
        (0, vitest_1.expect)(camera).toContain('portrait lens');
        (0, vitest_1.expect)(camera).toContain('full body lens');
        (0, vitest_1.expect)(camera).toContain('film stock');
    });
});
(0, vitest_1.describe)('buildMasterPrompt', () => {
    (0, vitest_1.it)('should return a valid MasterJSONPrompt with all fields', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.characterId).toBe('test-char-1');
        (0, vitest_1.expect)(prompt.subject).toBeTruthy();
        (0, vitest_1.expect)(prompt.clothing).toBeTruthy();
        (0, vitest_1.expect)(prompt.environment).toBeTruthy();
        (0, vitest_1.expect)(prompt.lighting).toBeTruthy();
        (0, vitest_1.expect)(prompt.camera).toBeTruthy();
        (0, vitest_1.expect)(prompt.aesthetic).toBeTruthy();
        (0, vitest_1.expect)(prompt.negative_prompt).toBeTruthy();
        (0, vitest_1.expect)(prompt.createdAt).toBeTruthy();
        (0, vitest_1.expect)(prompt.updatedAt).toBeTruthy();
    });
    (0, vitest_1.it)('should include character physical features in subject', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.subject).toContain('#F5D0A9');
        (0, vitest_1.expect)(prompt.subject).toContain('wavy');
        (0, vitest_1.expect)(prompt.subject).toContain('hourglass');
    });
    (0, vitest_1.it)('should include fashion style in clothing', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.clothing).toContain('casual-chic');
        (0, vitest_1.expect)(prompt.clothing).toContain('jeans');
        (0, vitest_1.expect)(prompt.clothing).toContain('crop top');
        (0, vitest_1.expect)(prompt.clothing).toContain('#000000');
    });
    (0, vitest_1.it)('should include camera settings with technical details', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.camera).toContain('Canon R5');
        (0, vitest_1.expect)(prompt.camera).toContain('85mm f/1.4');
        (0, vitest_1.expect)(prompt.camera).toContain('Portra 400');
    });
    (0, vitest_1.it)('should include makeup and fashion in aesthetic', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.aesthetic).toContain('natural');
        (0, vitest_1.expect)(prompt.aesthetic).toContain('casual-chic');
    });
    (0, vitest_1.it)('should include makeup colors in lighting', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.lighting).toContain('dewy');
        (0, vitest_1.expect)(prompt.lighting).toContain('#C48793');
    });
    (0, vitest_1.it)('should include profile view in environment', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.environment).toContain('left-45');
        (0, vitest_1.expect)(prompt.environment).toContain('hand-on-hip');
    });
    (0, vitest_1.it)('should have a non-empty negative prompt', () => {
        const dna = makeDNA();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        (0, vitest_1.expect)(prompt.negative_prompt).toContain('blurry');
        (0, vitest_1.expect)(prompt.negative_prompt).toContain('deformed');
    });
    (0, vitest_1.it)('should set ISO timestamps for createdAt and updatedAt', () => {
        const dna = makeDNA();
        const before = new Date().toISOString();
        const prompt = (0, prompt_builder_js_1.buildMasterPrompt)(dna);
        const after = new Date().toISOString();
        (0, vitest_1.expect)(prompt.createdAt >= before).toBe(true);
        (0, vitest_1.expect)(prompt.createdAt <= after).toBe(true);
        (0, vitest_1.expect)(prompt.updatedAt).toBe(prompt.createdAt);
    });
});
//# sourceMappingURL=prompt-builder.test.js.map