fix(search): no LA comparison for independent schools (H2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e659867590
commit
c7ddf0505d
6 files changed
+87
-6
No files matched your search
@@ -116,3 +116,38 @@ describe('SecondarySchoolRow shares the school page flags', () => {
|
||||
expect(screen.getByText('Fee-paying')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('SecondarySchoolRow LA comparison', () => {
|
||||
it('compares a state school with its LA average', () => {
|
||||
render(
|
||||
<SecondarySchoolRow
|
||||
school={{ ...base, school_type: 'Academy converter', attainment_8_score: 60 }}
|
||||
laAvgAttainment8={54.5}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByText(/\+5\.5 vs LA avg/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('keeps the comparison for a school whose type is unknown', () => {
|
||||
render(
|
||||
<SecondarySchoolRow
|
||||
school={{ ...base, school_type: null, attainment_8_score: 60 } as unknown as School}
|
||||
laAvgAttainment8={54.5}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByText(/\+5\.5 vs LA avg/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows an independent school's Attainment 8 without an LA comparison", () => {
|
||||
// DfE's LA average covers state-funded schools; an independent's
|
||||
// Attainment 8 leaves out IGCSEs (audit H2).
|
||||
render(
|
||||
<SecondarySchoolRow
|
||||
school={{ ...base, school_type: 'Other independent school', attainment_8_score: 20.4 }}
|
||||
laAvgAttainment8={54.5}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByText('20.4')).toBeInTheDocument();
|
||||
expect(screen.queryByText(/vs LA avg/)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user