import { describe, expect, it } from 'vitest';
import { alignContentWithBrandVoice, seoFieldToBrandChannel, COAUTHOR_BRAND_CHANNEL, } from '../../ai/brand-voice-alignment.js';
import { defaultStructuredProfile } from '../../ai/brand-voice-structured.js';
import { serializeBrandVoiceDocument } from '../../ai/brand-voice-document.js';
describe('brand-voice-alignment', () => {
    it('maps SEO description fields to meta_description channel', () => {
        expect(seoFieldToBrandChannel('metaDescription')).toBe('meta_description');
        expect(seoFieldToBrandChannel('ogDescription')).toBe('meta_description');
        expect(seoFieldToBrandChannel('metaTitle')).toBeUndefined();
    });
    it('scores copy when a profile document exists', () => {
        const structured = defaultStructuredProfile();
        structured.bannedTerms = [{ term: 'synergy', useInstead: 'collaboration' }];
        const document = serializeBrandVoiceDocument({
            fields: {
                name: 'Test',
                tone: 'clear',
                audience: 'marketers',
                guidelines: '- Be direct',
                sampleText: 'Sample on-brand copy.',
            },
            structured,
        });
        const result = alignContentWithBrandVoice('We drive synergy across teams.', {
            enabled: true,
            name: 'Test',
            tone: 'clear',
            document,
        }, COAUTHOR_BRAND_CHANNEL);
        expect(result).not.toBeNull();
        expect(result.score).toBeLessThan(100);
        expect(result.issues.some((i) => i.id.startsWith('banned-'))).toBe(true);
    });
    it('returns null when no profile is configured', () => {
        expect(alignContentWithBrandVoice('Hello', null)).toBeNull();
    });
});
//# sourceMappingURL=brand-voice-alignment.test.js.map