diff --git a/data/CONTRIBUTING.md b/data/CONTRIBUTING.md index e65713b..6840d91 100644 --- a/data/CONTRIBUTING.md +++ b/data/CONTRIBUTING.md @@ -36,7 +36,7 @@ below is also machine-enforced by [`places.schema.json`](places.schema.json), wh **Fields:** - `id`: `--`. Prefix is a short slug for the city (e.g. `mum`, `thane`, `navi`, `ldn`, `jkt`). Increment from the highest existing number in the file for that prefix. -- `city`: lowercase, underscore-separated slug (e.g. `mumbai`, `navi_mumbai`, `jakarta`). Any city worldwide is welcome, not just Mumbai/Thane/Navi Mumbai. +- `city`: lowercase, underscore-separated slug (e.g. `mumbai`, `navi_mumbai`, `jakarta`). Any city worldwide is welcome, not just Mumbai/Thane/Navi Mumbai. If a city name is already used for a different city, append the state, province, or country (e.g. `london_ontario` or `york_pennsylvania`). - `country`: optional for now. The place's ISO 3166-1 alpha-2 country code in capitals (e.g. `IN`, `GB`, `KE`), the same codes competitions use. Lowercase or a country name fails `npm run validate`. Existing records are being backfilled, after which it becomes required (#288). - `type`: must match the filename exactly - `lat`/`lng`: from Google Maps (right-click pin, "What's here?"). Any real-world coordinate works: `places.schema.json` checks latitude is between -90 and 90 and longitude between -180 and 180. diff --git a/data/places/sat_centre.json b/data/places/sat_centre.json index 5ddaf23..5a4bc90 100644 --- a/data/places/sat_centre.json +++ b/data/places/sat_centre.json @@ -1095,7 +1095,7 @@ "id": "96390", "name": "London International Academy", "type": "sat_centre", - "city": "london", + "city": "london_ontario", "lat": 43.0323638, "lng": -81.1487638, "address": "361-365 Richmond Street, Downtown, London, Ontario", @@ -1732,7 +1732,7 @@ "id": "33154", "name": "Fox Lane High School", "type": "sat_centre", - "city": "bedford", + "city": "bedford_new_york", "lat": 41.1917153, "lng": -73.6777249, "address": "632 South Bedford Rd", @@ -2317,7 +2317,7 @@ "id": "07140", "name": "Bristol Central High School", "type": "sat_centre", - "city": "bristol", + "city": "bristol_connecticut", "lat": 41.6622844, "lng": -72.9608052, "address": "Bristol Central High School", @@ -2369,7 +2369,7 @@ "id": "07145", "name": "Bristol Eastern High School", "type": "sat_centre", - "city": "bristol", + "city": "bristol_connecticut", "lat": 41.686179, "lng": -72.9221639, "address": "632 King Street", @@ -2642,11 +2642,11 @@ "id": "39616", "name": "Reading Senior High School", "type": "sat_centre", - "city": "reading", - "lat": 40.5061969, - "lng": -122.379165, + "city": "reading_pennsylvania", + "lat": 40.336932, + "lng": -75.926874, "address": "801 North 13th Street", - "gmaps_link": "https://maps.google.com/?q=40.5061969,-122.379165", + "gmaps_link": "https://maps.google.com/?q=40.336932,-75.926874", "added_by": "shauryagangrade", "exam": "SAT", "valid_till": "2026-11-07" @@ -2655,7 +2655,7 @@ "id": "07330", "name": "Manchester High School", "type": "sat_centre", - "city": "manchester", + "city": "manchester_connecticut", "lat": 41.7803878, "lng": -72.5165086, "address": "134 Middle Tpke E", @@ -2772,7 +2772,7 @@ "id": "33282", "name": "Cairo-Durham High School", "type": "sat_centre", - "city": "cairo", + "city": "cairo_new_york", "lat": 42.3407198, "lng": -74.0621583, "address": "1301 RT 145", @@ -3019,7 +3019,7 @@ "id": "21100", "name": "Aberdeen High School", "type": "sat_centre", - "city": "aberdeen", + "city": "aberdeen_maryland", "lat": 39.5161727, "lng": -76.170309, "address": "251 Paradise Road", @@ -3058,7 +3058,7 @@ "id": "39740", "name": "Central York High School", "type": "sat_centre", - "city": "york", + "city": "york_pennsylvania", "lat": 40.014487, "lng": -76.7005724, "address": "601 Mundis Mill Road", @@ -3071,7 +3071,7 @@ "id": "39744", "name": "York Suburban Senior High School", "type": "sat_centre", - "city": "york", + "city": "york_pennsylvania", "lat": 39.9488471, "lng": -76.6932608, "address": "1800 Hollywood Drive", @@ -3435,7 +3435,7 @@ "id": "21171", "name": "Stephen Decatur High School", "type": "sat_centre", - "city": "berlin", + "city": "berlin_maryland", "lat": 38.3398883, "lng": -75.189871, "address": "9913 Seahawk Road", @@ -3617,7 +3617,7 @@ "id": "21774", "name": "Wicomico County Evening High School", "type": "sat_centre", - "city": "salisbury", + "city": "salisbury_maryland", "lat": 38.3671033, "lng": -75.5815837, "address": "916 S Schumaker Dr", @@ -3864,11 +3864,11 @@ "id": "87361", "name": "The Southport School", "type": "sat_centre", - "city": "southport", - "lat": -43.430637, - "lng": 146.975402, + "city": "southport_queensland", + "lat": -27.986552, + "lng": 153.414119, "address": "2 Winchester Street", - "gmaps_link": "https://maps.google.com/?q=-43.430637,146.975402", + "gmaps_link": "https://maps.google.com/?q=-27.986552,153.414119", "added_by": "shauryagangrade", "exam": "SAT", "valid_till": "2026-11-07" diff --git a/src/lib/places.test.ts b/src/lib/places.test.ts index d930950..3c81e6d 100644 --- a/src/lib/places.test.ts +++ b/src/lib/places.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; +import satCentres from "../../data/places/sat_centre.json"; import { cityBounds, filterPlaces, getCities } from "@/lib/places"; import type { Place } from "@/lib/types"; @@ -148,3 +149,28 @@ describe("cityBounds", () => { }); }); }); + +describe("SAT centre city slugs", () => { + it("keeps same-named North American centres out of unrelated city pages", () => { + const expectedCities: Record = { + "96390": "london_ontario", + "07330": "manchester_connecticut", + "21171": "berlin_maryland", + "33282": "cairo_new_york", + "33154": "bedford_new_york", + "39616": "reading_pennsylvania", + "39740": "york_pennsylvania", + "39744": "york_pennsylvania", + "21100": "aberdeen_maryland", + "07140": "bristol_connecticut", + "07145": "bristol_connecticut", + "21774": "salisbury_maryland", + "87361": "southport_queensland", + }; + + for (const [id, city] of Object.entries(expectedCities)) { + expect(satCentres.find((centre) => centre.id === id)?.city).toBe(city); + } + expect(satCentres.find((centre) => centre.id === "59096")?.city).toBe("arona"); + }); +});