// [DEF:frontend.src.lib.components.reports.__tests__.reports_page.integration:Module]
// @TIER: STANDARD
// @SEMANTICS: tests, reports, integration, mixed-types, rendering
// @PURPOSE: Integration-style checks for unified mixed-type reports rendering expectations.
// @LAYER: UI (Tests)
// @RELATION: TESTS -> frontend/src/routes/reports/+page.svelte
// @RELATION: TESTS -> frontend/src/lib/components/reports/ReportsList.svelte
// @INVARIANT: Mixed fixture includes all supported report types in one list.

import { describe, it, expect } from 'vitest';
import { mixedTaskReports } from './fixtures/reports.fixtures.js';

function collectVisibleTypeLabels(items) {
  return items.map((item) => item.task_type);
}

describe('Reports page integration - unified mixed type rendering', () => {
  it('contains mixed reports from all primary task types in one payload', () => {
    const labels = collectVisibleTypeLabels(mixedTaskReports);

    expect(labels).toContain('llm_verification');
    expect(labels).toContain('backup');
    expect(labels).toContain('migration');
    expect(labels).toContain('documentation');
    expect(mixedTaskReports.length).toBeGreaterThanOrEqual(4);
  });

  it('ensures canonical minimum fields are present for each report item', () => {
    for (const report of mixedTaskReports) {
      expect(typeof report.report_id).toBe('string');
      expect(typeof report.task_id).toBe('string');
      expect(typeof report.task_type).toBe('string');
      expect(typeof report.status).toBe('string');
      expect(typeof report.summary).toBe('string');
      expect(report.updated_at).toBeTruthy();
    }
  });
});

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