import { TestBed } from '@angular/core/testing';
import { AccessibilityStatement } from './accessibility';

describe('AccessibilityStatement', () => {
  beforeEach(async () => {
    await TestBed.configureTestingModule({ imports: [AccessibilityStatement] }).compileComponents();
  });

  it('renders the heading + intro + status sections', async () => {
    const fixture = TestBed.createComponent(AccessibilityStatement);
    await fixture.whenStable();
    const root = fixture.nativeElement as HTMLElement;
    expect(root.querySelector('h1')?.textContent?.trim()).toBe('Accessibility statement');
    expect(root.querySelector('section[aria-labelledby="intro-heading"]')).not.toBeNull();
    expect(root.querySelector('section[aria-labelledby="status-heading"]')).not.toBeNull();
  });

  it('exposes the panel-review status with an amber callout structure', async () => {
    const fixture = TestBed.createComponent(AccessibilityStatement);
    await fixture.whenStable();
    const root = fixture.nativeElement as HTMLElement;
    const status = root.querySelector('section[aria-labelledby="status-heading"]');
    expect(status?.querySelector('#status-heading')?.textContent).toContain(
      'Status of this document',
    );
    expect(status?.textContent).toContain('APF France handicap user panel');
  });
});
