import { describe, expect, it } from 'vitest';

import { buildFluxSocialImagePrompt } from '../social-image-prompts';

describe('social image prompt builder', () => {
  it('strips text/logo filler from the positive prompt and keeps it in the negative prompt', () => {
    const result = buildFluxSocialImagePrompt(
      'LeBron driving through traffic, dramatic arena shot, no text, no logos, no watermark',
      'nba',
    );

    expect(result.prompt.toLowerCase()).not.toContain('no text');
    expect(result.prompt.toLowerCase()).not.toContain('logo');
    expect(result.negativePrompt).toContain('text');
    expect(result.negativePrompt).toContain('logo');
    expect(result.prompt.toLowerCase()).toContain('bright arena lights');
  });

  it('keeps prompts short enough for the smaller Flux model defaults', () => {
    const result = buildFluxSocialImagePrompt(
      'Quarterback sprinting left with two defenders closing in, rain kicking up off the turf, sideline chaos, stadium crowd exploding, cinematic broadcast angle, ultra dramatic composition, intense emotion on every face, championship game energy, vivid contrast, hard rim lighting',
      'nfl',
    );

    expect(result.prompt.split(/\s+/).length).toBeLessThanOrEqual(42);
  });
});
