test: align navigation and sign label checks with the gantry
This commit is contained in:
@@ -18,6 +18,16 @@ const sections = [
|
||||
|
||||
test.beforeEach(async ({ page }) => installSceneInstrumentation(page));
|
||||
|
||||
|
||||
/**
|
||||
* The gantry window pre-draws its hover twin for the exit it rests on, which
|
||||
* is Start at load. That is a window texture, not a roadside sign, so it is
|
||||
* left out of the roadside label checks; Start never has a roadside sign.
|
||||
*/
|
||||
function roadsideLabels(labels: readonly string[]): string[] {
|
||||
return labels.filter((label) => label !== 'Start');
|
||||
}
|
||||
|
||||
test('keeps navigation, HUD, progress, chapter, and arrival on the same next-frame section snapshot', async ({
|
||||
page,
|
||||
distUrl,
|
||||
@@ -105,7 +115,7 @@ test('draws only the independently eligible next roadside sign during passive fo
|
||||
await waitForOneAnimationFrame(page);
|
||||
|
||||
await expect.poll(async () => (await readSceneInstrumentation(page)).routeLabelsDrawn).toContain(oracle.expectedLabel);
|
||||
const labels = (await readSceneInstrumentation(page)).routeLabelsDrawn;
|
||||
const labels = roadsideLabels((await readSceneInstrumentation(page)).routeLabelsDrawn);
|
||||
expect([...new Set(labels)]).toEqual([oracle.expectedLabel]);
|
||||
});
|
||||
|
||||
@@ -235,12 +245,12 @@ test('shows exactly one destination sign for a navigator click and suppresses hi
|
||||
await expect(page.locator('#selected-builds-heading')).toBeFocused();
|
||||
await page.waitForTimeout(2_400);
|
||||
const afterRepeat = await readSceneInstrumentation(page);
|
||||
expect(afterRepeat.routeLabelsDrawn).toEqual(['Selected builds']);
|
||||
expect(roadsideLabels(afterRepeat.routeLabelsDrawn)).toEqual(['Selected builds']);
|
||||
expect(countSignPresentations(afterRepeat.signFrames, 'selected-builds')).toBe(1);
|
||||
|
||||
await page.goBack({ waitUntil: 'domcontentloaded' });
|
||||
await page.waitForTimeout(400);
|
||||
expect((await readSceneInstrumentation(page)).routeLabelsDrawn).toEqual(['Selected builds']);
|
||||
expect(roadsideLabels((await readSceneInstrumentation(page)).routeLabelsDrawn)).toEqual(['Selected builds']);
|
||||
});
|
||||
|
||||
test('keeps the non-navigator Explore work section jump sign-suppressed', async ({
|
||||
@@ -430,7 +440,7 @@ test('moves an already-readable portrait sign into navigator-safe placement with
|
||||
|
||||
const instrumentation = await readSceneInstrumentation(page);
|
||||
expect(countSignPresentations(instrumentation.signFrames, 'profile')).toBe(1);
|
||||
expect(instrumentation.routeLabelsDrawn).toEqual(['Profile']);
|
||||
expect(roadsideLabels(instrumentation.routeLabelsDrawn)).toEqual(['Profile']);
|
||||
});
|
||||
|
||||
test('re-arms passive signage after a navigator round trip to Start', async ({
|
||||
@@ -495,7 +505,7 @@ test('reconciles an idle rapid jump to the latest active route without flashing
|
||||
frame.targetId === 'selected-builds'
|
||||
))?.phase, { intervals: [16], timeout: 5_000 }).toBe('dwell');
|
||||
const instrumentation = await readSceneInstrumentation(page);
|
||||
expect([...new Set(instrumentation.routeLabelsDrawn)])
|
||||
expect([...new Set(roadsideLabels(instrumentation.routeLabelsDrawn))])
|
||||
.toEqual(['Selected builds']);
|
||||
const dwell = instrumentation.signFrames.findLast((frame) => (
|
||||
frame.targetId === 'selected-builds' && frame.phase === 'dwell'
|
||||
|
||||
Reference in New Issue
Block a user