From fdc5624b0c554ebbf8be9ec8f5a27d03c985d2ea Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Tue, 29 Sep 2026 15:37:45 +0000 Subject: [PATCH] fix(e2e): make the #35 NAV AI spec survive tab restore and multi-match sublabels --- e2e/smoke.spec.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e/smoke.spec.ts b/e2e/smoke.spec.ts index ce56b2c..840250e 100644 --- a/e2e/smoke.spec.ts +++ b/e2e/smoke.spec.ts @@ -417,12 +417,15 @@ test('NAVIGATION AI research unlocks two-hop jumps on the world map (#35)', asyn expect(target).toBeDefined(); 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(); const panel = page.getByRole('tabpanel'); const turnBefore = world.turn; - // The two-hop systems render as distinct chart fields (// JUMP ×2 sublabel), and the target is one of them. - await expect(panel.getByText(/(DISCOVERED|UNKNOWN) \/\/ JUMP ×2/)).toBeVisible(); + // 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/).first()).toBeVisible(); await panel.getByRole('button', { name: target.name.toUpperCase() }).click(); const after = (await (await page.request.get('/api/world')).json()) as WorldState;