Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(e2e): locate the panel tabs by aria-label, the tab bar has a Plan button too

Maurice8c538db74db8
diff --git a/client/e2e/ipad-scroll-1432.spec.ts b/client/e2e/ipad-scroll-1432.spec.ts
index be5431c9c..c7cc854a9 100644
--- a/client/e2e/ipad-scroll-1432.spec.ts
+++ b/client/e2e/ipad-scroll-1432.spec.ts
@@ -44,7 +44,9 @@ test('#1432 iPad: places list is scrollable, not draggable', async ({ page }) =>
// An iPad is inside the 768-1023px band, where only one side panel is open at a
// time so the map keeps a usable width (#2247). The places list is one tap away.
- await page.getByRole('button', { name: 'Places' }).click()
+ // Located by the tab's own aria-label, not by role+name: the tab bar carries a
+ // "Plan" button of its own.
+ await page.locator('button[aria-label="Places"]').click()
await expect(page.getByText('Place 1').first()).toBeVisible({ timeout: 20_000 })
// The context must really be the one from the bug report: coarse pointer, desktop
@@ -79,7 +81,8 @@ test('#1432 iPad: places list is scrollable, not draggable', async ({ page }) =>
expect(['1', 'absent']).toContain(arrowOpacity)
// 4. The iPad must still get the desktop shell — isMobile stayed width-based. One
- // panel at a time (#2247), so opening Places closed the day plan.
+ // panel at a time (#2247), so opening Places closed the day plan and left its
+ // tab as the way back.
await expect(page.locator('.leaflet-container')).toBeVisible()
- await expect(page.getByRole('button', { name: 'Plan' })).toBeVisible()
+ await expect(page.locator('button[aria-label="Plan"]')).toBeVisible()
})