// [DEF:frontend.src.lib.components.reports.__tests__.report_type_profiles:Module]
// @TIER: STANDARD
// @SEMANTICS: tests, reports, type-profiles, fallback
// @PURPOSE: Validate report type profile mapping and unknown fallback behavior.
// @LAYER: UI (Tests)
// @RELATION: TESTS -> frontend/src/lib/components/reports/reportTypeProfiles.js
// @INVARIANT: Unknown task_type always resolves to the fallback profile.

import { describe, it, expect } from 'vitest';
import { getReportTypeProfile, REPORT_TYPE_PROFILES } from '../reportTypeProfiles.js';

describe('report type profiles', () => {
  it('returns dedicated profiles for known task types', () => {
    expect(getReportTypeProfile('llm_verification').key).toBe('llm_verification');
    expect(getReportTypeProfile('backup').key).toBe('backup');
    expect(getReportTypeProfile('migration').key).toBe('migration');
    expect(getReportTypeProfile('documentation').key).toBe('documentation');
  });

  it('returns fallback profile for unknown task type', () => {
    const profile = getReportTypeProfile('something_new');
    expect(profile.key).toBe('unknown');
    expect(profile.fallback).toBe(true);
  });

  it('contains exactly one fallback profile in registry', () => {
    const fallbackCount = Object.values(REPORT_TYPE_PROFILES).filter((p) => p.fallback === true).length;
    expect(fallbackCount).toBe(1);
  });
});

// [/DEF:frontend.src.lib.components.reports.__tests__.report_type_profiles:Module]