import { ArchiveReportService } from './archive-report.service';

describe('ArchiveReportService retired profile fields', () => {
  it('does not render the retired campus field in a student report', async () => {
    const service = new ArchiveReportService(
      { findOne: jest.fn().mockResolvedValue({ campusLocation: '旧校区', grade: '高三' }) } as never,
      { find: jest.fn().mockResolvedValue([]) } as never,
      { find: jest.fn().mockResolvedValue([]) } as never,
      { find: jest.fn().mockResolvedValue([]) } as never,
      { findOne: jest.fn().mockResolvedValue(null) } as never,
      { find: jest.fn().mockResolvedValue([]) } as never,
      {
        findOne: jest.fn().mockResolvedValue({
          id: 1,
          name: '测试学生',
          gender: '男',
          phone: '',
          ethnicity: '',
          emergencyContact: '',
          emergencyPhone: '',
        }),
      } as never,
    );

    const html = await service.generateReportHtml(1);

    expect(html).not.toContain('旧校区');
    expect(html).not.toContain('<span>校区</span>');
    expect(html).toContain('高三');
  });
});
