test(e2e): a no-faith comprehensive makes no Selective or faith claim
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m13s
PR Checks / Backend Smoke (pull_request) Successful in 10s
PR Checks / Build Backend (no push) (pull_request) Successful in 19s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m20s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 16s
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m13s
PR Checks / Backend Smoke (pull_request) Successful in 10s
PR Checks / Build Backend (no push) (pull_request) Successful in 19s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m20s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 11s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 16s
The Admissions section of a non-selective secondary with no religious character must say neither "Selective:" nor "Faith priority:". Run against staging before the fix, it fails on "Faith priority" (Burntwood's "(None)"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ef4a2ccccb
commit
da5d63593f
1 file changed
+28
@@ -3396,3 +3396,31 @@ test('a selective school is flagged Selective, on its page and in search', async
|
|||||||
const tags = await rowTags(page, school);
|
const tags = await rowTags(page, school);
|
||||||
await expect(tags.getByText('Selective', { exact: true })).toBeVisible();
|
await expect(tags.getByText('Selective', { exact: true })).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Admissions section repeated the search rows' old tag logic: "selective"
|
||||||
|
* matched inside "Non-selective", and "None" counted as a faith, so Burntwood
|
||||||
|
* read "this school has a faith-based admissions priority (None)". The
|
||||||
|
* Selective half stayed hidden only because the school page's API did not
|
||||||
|
* send admissions_policy. Data-invariant: the school comes from the API, and
|
||||||
|
* must have an Admissions section to read.
|
||||||
|
*/
|
||||||
|
test('a non-selective school with no faith makes neither claim in its Admissions section', async ({ page }) => {
|
||||||
|
const res = await page.request.get(
|
||||||
|
'/api/schools?search=school&phase=secondary&faith=none&admissions_policy=non-selective&page_size=20');
|
||||||
|
expect(res.ok()).toBeTruthy();
|
||||||
|
let urn: number | null = null;
|
||||||
|
for (const s of ((await res.json()).schools ?? []).slice(0, 8)) {
|
||||||
|
if (s.religious_denomination !== 'None') continue;
|
||||||
|
const detail = await (await page.request.get(`/api/schools/${s.urn}`)).json();
|
||||||
|
if (detail.admissions) { urn = s.urn; break; }
|
||||||
|
}
|
||||||
|
test.skip(urn == null, 'no non-selective, no-faith secondary with admissions data here');
|
||||||
|
|
||||||
|
await page.goto(`/school/${urn}`);
|
||||||
|
const admissions = page.locator('section#admissions');
|
||||||
|
await expect(admissions).toBeVisible({ timeout: 15_000 });
|
||||||
|
await expect(admissions.getByText('Selective:', { exact: true })).toHaveCount(0);
|
||||||
|
await expect(admissions.getByText('Faith priority:', { exact: true })).toHaveCount(0);
|
||||||
|
await expect(admissions.getByText(/\(None\)/)).toHaveCount(0);
|
||||||
|
});
|
||||||
Reference in new issue
Block a user