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:
1 parent
ab25d83b9d
commit
9feb37b974
12 files changed
+143
-16
No files matched your search
@@ -69,6 +69,18 @@ const data: Record<string, ComparisonData> = {
|
||||
};
|
||||
|
||||
describe('CompareOfsted', () => {
|
||||
it('words a school without an Ofsted record from the evidence (audit H4)', () => {
|
||||
const isi = { ...school(4, 'ISI School'), inspectorate: 'ISI' } as School;
|
||||
const listed = { ...school(5, 'New Academy'), ofsted_listed: true } as School;
|
||||
render(<CompareOfsted schools={[isi, listed]} data={{
|
||||
'4': { school_info: isi, yearly_data: [] } as unknown as ComparisonData,
|
||||
'5': { school_info: listed, yearly_data: [] } as unknown as ComparisonData,
|
||||
}} />);
|
||||
expect(screen.getAllByText('Inspected by ISI').length).toBeGreaterThan(0);
|
||||
expect(screen.getAllByText('Not yet inspected').length).toBeGreaterThan(0);
|
||||
expect(screen.queryByText(/No inspection outcome in our dataset/)).toBeNull();
|
||||
});
|
||||
|
||||
it('renders the three regimes without inventing an overall grade for report cards', () => {
|
||||
render(<CompareOfsted schools={schools} data={data} />);
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
@@ -82,3 +82,14 @@ it('prints an ungraded outcome when there is no grade (Oakgrove)', () => {
|
||||
expect(screen.getByText('No overall grade')).toBeInTheDocument();
|
||||
expect(screen.getByText(/Ungraded inspection, 13 November 2024: Standards maintained/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('labels a further education record and prints its short inspection (audit H4)', () => {
|
||||
renderSection({
|
||||
framework: 'Further education and skills',
|
||||
current_grade: { grade: 2, date: '2019-03-05', basis: 'graded' },
|
||||
latest_visit: { date: '2023-02-01', kind: 'short', outcome: null },
|
||||
});
|
||||
expect(screen.getByText('Further education and skills')).toBeInTheDocument();
|
||||
expect(screen.getByText('Good')).toBeInTheDocument();
|
||||
expect(screen.getByText('Latest visit: Short inspection, 1 February 2023')).toBeInTheDocument();
|
||||
});
|
||||
Reference in new issue
Block a user