import { createListPageTests } from '../../test/factories/listPageTests';
import ConsultationList from './ConsultationList';

const mockConsultations = Array.from({ length: 8 }, (_, i) => ({
  id: `consult-${i + 1}`,
  patient_id: `patient-${i + 1}`,
  patient_name: `患者${i + 1}`,
  doctor_id: `doctor-1`,
  doctor_name: '李医生',
  status: (['waiting', 'active', 'closed'] as const)[i % 3],
  type: 'online',
  created_at: '2026-04-01T10:00:00Z',
  updated_at: '2026-04-01T10:00:00Z',
  version: 1,
}));

createListPageTests({
  Component: ConsultationList,
  apiPath: '/api/v1/health/consultation-sessions',
  columns: ['患者', '医护', '状态'],
  firstRowTexts: ['患者1'],
  totalItems: 8,
  hasCreateButton: true,
  createButtonText: '新建会话',
  hasSearch: true,
  hasPagination: false,
  mockItems: mockConsultations as Record<string, unknown>[],
});
