fix(e2e): make the #35 NAV AI spec survive tab restore and multi-match sublabels
CI / build + unit + e2e (pull_request) Successful in 3m7s

This commit is contained in:
2026-09-29 15:37:45 +00:00
parent ff4ced9d71
commit fdc5624b0c
+5 -2
View File
@@ -417,12 +417,15 @@ test('NAVIGATION AI research unlocks two-hop jumps on the world map (#35)', asyn
expect(target).toBeDefined(); expect(target).toBeDefined();
await page.goto('/'); // fresh chart with NAV AI researched — two-hop fields are clickable now await page.goto('/'); // fresh chart with NAV AI researched — two-hop fields are clickable now
// #27 restores whatever tab a previous step persisted (SKILL TREE after the research above), so
// activate WORLD MAP explicitly before asserting on the chart.
await page.getByRole('tab', { name: 'WORLD MAP' }).click();
await expect(page.getByText(/GALACTIC CHART \/\/ JUMP ROUTES — TURN \d+/)).toBeVisible(); await expect(page.getByText(/GALACTIC CHART \/\/ JUMP ROUTES — TURN \d+/)).toBeVisible();
const panel = page.getByRole('tabpanel'); const panel = page.getByRole('tabpanel');
const turnBefore = world.turn; const turnBefore = world.turn;
// The two-hop systems render as distinct chart fields (// JUMP ×2 sublabel), and the target is one of them. // The two-hop systems render as distinct chart fields (// JUMP ×2 sublabel) — several at once, so .first().
await expect(panel.getByText(/(DISCOVERED|UNKNOWN) \/\/ JUMP ×2/)).toBeVisible(); await expect(panel.getByText(/(DISCOVERED|UNKNOWN) \/\/ JUMP ×2/).first()).toBeVisible();
await panel.getByRole('button', { name: target.name.toUpperCase() }).click(); await panel.getByRole('button', { name: target.name.toUpperCase() }).click();
const after = (await (await page.request.get('/api/world')).json()) as WorldState; const after = (await (await page.request.get('/api/world')).json()) as WorldState;