fix(e2e): make the #35 NAV AI spec survive tab restore and multi-match sublabels
CI / build + unit + e2e (pull_request) Successful in 3m7s
CI / build + unit + e2e (pull_request) Successful in 3m7s
This commit is contained in:
+5
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user