fix(school, compare): ISI, not-yet-inspected and further-education states (H4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
TudorandClaude Opus 5.5 committed 2026-10-13 21:35:10 +01:00
1 parent ab25d83b9d
commit 9feb37b974
12 files changed
+143 -16

No files matched your search

@@ -0,0 +1,20 @@
import { render, screen } from '@testing-library/react';
import { InspectionNotice } from '@/components/school/InspectionNotice';
it('names ISI and links its reports for an ISI school (audit H4)', () => {
render(<InspectionNotice school={{ urn: 136083, inspectorate: 'ISI', ofsted_listed: false }} />);
expect(screen.getByText('Inspected by the Independent Schools Inspectorate (ISI)')).toBeInTheDocument();
expect(screen.getByRole('link', { name: /ISI reports/ })).toHaveAttribute('href', 'https://www.isi.net/reports/');
});
it('says "Not yet inspected" for a school Ofsted lists without an inspection', () => {
render(<InspectionNotice school={{ urn: 150031, inspectorate: 'Not applicable', ofsted_listed: true }} />);
expect(screen.getByText('Not yet inspected')).toBeInTheDocument();
expect(screen.getByRole('link', { name: /Ofsted reports/ })).toHaveAttribute(
'href', 'https://reports.ofsted.gov.uk/inspection-reports/find-inspection-report/provider/ELS/150031');
});
it('renders nothing without inspection data, including an unknown listing', () => {
const { container } = render(<InspectionNotice school={{ urn: 1, inspectorate: null, ofsted_listed: null }} />);
expect(container).toBeEmptyDOMElement();
});