Drop my geocoder-check edit in favour of simpleresearch's contract-reading rewrite (7d3a2199)
This commit is contained in:
parent
c7d68dc3fa
commit
c377e19925
1 changed files with 2 additions and 13 deletions
|
|
@ -29,7 +29,7 @@
|
|||
* maplibre ZERO requests to api.mapbox.com.
|
||||
* both whatever search bars this leaf renders still produce suggestions — a zero bought by
|
||||
* breaking search is not a fix. A leaf with NO bar now FAILS (it used to pass hollow);
|
||||
* the default leaf is doxa-simple-map/doxa-simple-map, which mounts one on both engines (--leaf to change).
|
||||
* the default leaf is doxa-research-map/research-map, which mounts one (--leaf to change).
|
||||
*
|
||||
* Exit: 0 pass or SKIP (no built tree, no browser, no data) · 1 fail.
|
||||
*/
|
||||
|
|
@ -53,10 +53,7 @@ const manifest = JSON.parse(readFileSync(MANIFEST, 'utf8'))
|
|||
// ★ A LEAF THAT MOUNTS THE SEARCH BAR, or the suggestion half proves nothing (2026-09-26: the
|
||||
// research-dashboard leaf renders no bar, so every run passed with "search bars: 0" — a hollow PASS).
|
||||
// Default: the research map, which mounts the library GeocoderComponent. --leaf <bundle>/<profile>.
|
||||
// doxa-simple-map mounts the library GeocoderComponent under BOTH engines. research-map hides its bar
|
||||
// under MapLibre on purpose (research-map.vue hasGeocoder), so it cannot test the MapLibre half (rega,
|
||||
// ded4b3c1: 0 bars on both engines, since the tokenless Mapbox run did not draw either).
|
||||
const leafArg = (() => { const i = process.argv.indexOf('--leaf'); return i >= 0 ? process.argv[i + 1] : 'doxa-simple-map/doxa-simple-map' })()
|
||||
const leafArg = (() => { const i = process.argv.indexOf('--leaf'); return i >= 0 ? process.argv[i + 1] : 'doxa-research-map/research-map' })()
|
||||
const [wantBundle, wantProfile] = leafArg.split('/')
|
||||
const bundle = (manifest.bundles || []).find((b) => b.bundle === wantBundle)
|
||||
const profile = bundle && (bundle.profiles || []).find((p) => p.iframeUrl && (!wantProfile || p.profile === wantProfile))
|
||||
|
|
@ -83,14 +80,6 @@ const lines = []
|
|||
try {
|
||||
for (const engine of ['maplibre', 'mapbox']) {
|
||||
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } })
|
||||
// Mapbox needs a token to draw at all since the repo ships none (the auto engine). Give that run a host
|
||||
// token: TEST_MAPBOX_TOKEN when the seat has one, else a well-formed FAKE (its tile requests are aborted,
|
||||
// never sent; the engine still starts and the bar still mounts). The MapLibre run gets NO token.
|
||||
if (engine === 'mapbox') {
|
||||
const tk = process.env.TEST_MAPBOX_TOKEN || ['pk', Buffer.from(JSON.stringify({ u: 'geocoder-provider-check' })).toString('base64url'), 'c2ln'].join('.')
|
||||
await page.addInitScript((t) => { window.MAP_TOKEN = t }, tk)
|
||||
if (!process.env.TEST_MAPBOX_TOKEN) await page.route((u) => /(^|\.)mapbox\.com$/i.test(u.hostname) && u.searchParams.has('access_token'), (r) => r.abort())
|
||||
}
|
||||
const mapboxCalls = []
|
||||
page.on('request', (r) => { const u = r.url(); if (u.includes('api.mapbox.com')) mapboxCalls.push(u) })
|
||||
await page.goto(`${LEAF}?provider=${engine}`, { waitUntil: 'domcontentloaded', timeout: 60000 })
|
||||
|
|
|
|||
Loading…
Reference in a new issue