test(street-level): settle coverage before reading the ON/OFF pill

The pill step read #sl-status straight after the credit wait. Tiles
requested while Cesium painted the credit can flip it back to LOADING,
which failed CI on PR #1038 (actual 'BUTTON:LOADING:true'). Wait for
coverage to settle and the pill to read ON before asserting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Said TurkseverandClaude Opus 5.5 committed 2026-10-15 16:06:30 +01:00
1 parent 4d88dd29f5
commit 4e7c5c24e1
1 file changed
+7
+7
View File
@@ -1321,6 +1321,13 @@ async function main() {
await step(
'the header ON/OFF pill switches the layer off and on',
async () => {
// Tiles requested while the credit painted can flip the pill back
// to LOADING, so let coverage settle before reading it.
await waitForCoverage(page);
await settle(
page,
() => document.getElementById('sl-status').textContent === 'ON',
);
assert.equal(
await page.$eval('#sl-status', (node) =>
[