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): the iPad case checks what broke #1432, the guides read today's texts

Maurice960520c6d98b
diff --git a/client/e2e/help/trip-place.guide.ts b/client/e2e/help/trip-place.guide.ts
index 7178a9062..f99557dee 100644
--- a/client/e2e/help/trip-place.guide.ts
+++ b/client/e2e/help/trip-place.guide.ts
@@ -459,12 +459,12 @@ const SCRIPTS: Record<string, GuideScript> = {
target: p => card(p).getByText('Upload', { exact: true }),
act: async p => {
await card(p).locator('input[type="file"][multiple]').setInputFiles(await coverFixture())
- await expect(card(p).getByRole('button', { name: '1 files' })).toBeVisible({ timeout: 30_000 })
+ await expect(card(p).getByRole('button', { name: '1 file', exact: true })).toBeVisible({ timeout: 30_000 })
await settle(p)
},
},
// The list opens itself once the upload lands.
- only(p => card(p).getByRole('button', { name: '1 files' })),
+ only(p => card(p).getByRole('button', { name: '1 file', exact: true })),
// No click: openFile hands the browser a download.
only(p => card(p).getByRole('button', { name: UPLOADED })),
],
diff --git a/client/e2e/help/trip-transports.guide.ts b/client/e2e/help/trip-transports.guide.ts
index 9d023eaae..b7216ea1a 100644
--- a/client/e2e/help/trip-transports.guide.ts
+++ b/client/e2e/help/trip-transports.guide.ts
@@ -650,7 +650,7 @@ const SCRIPTS: Record<string, GuideScript> = {
await importCta(p).click()
await expect(p.getByText('Import from AirTrail', { exact: true })).toHaveCount(0, { timeout: 30_000 })
// The toast counts flight ids, so the joined pair reports two.
- const toast = p.getByText('2 flight(s) imported', { exact: true })
+ const toast = p.getByText('2 flights imported', { exact: true })
await expect(toast).toBeVisible({ timeout: 15_000 })
await expect(card(p, JOINED.title)).toBeVisible({ timeout: 20_000 })
// The toast fades after three seconds; the card's picture and the
diff --git a/client/e2e/ipad-scroll-1432.spec.ts b/client/e2e/ipad-scroll-1432.spec.ts
index 71f3a5f05..a6dc74091 100644
--- a/client/e2e/ipad-scroll-1432.spec.ts
+++ b/client/e2e/ipad-scroll-1432.spec.ts
@@ -61,8 +61,13 @@ test('#1432 iPad: the places list scrolls under a swipe', async ({ page }) => {
expect(env.coarse, 'iPad reports a coarse primary pointer').toBe(true)
expect(env.width, 'iPad sits above the 768px "mobile" breakpoint').toBeGreaterThanOrEqual(768)
- // 1. A swipe must not become a drag: a row is either not draggable, or draggable
- // only behind the long-press bridge (#1616).
+ // 1. A swipe must not become a drag. What turned it into one in #1432 was the
+ // drag-drop-touch polyfill; it belongs to hybrid laptops only now
+ // (utils/touchDragPolyfill.ts), so a tablet must never load it. A row may be
+ // draggable, but only behind the long-press bridge (#1616).
+ const polyfillLoaded = await page.evaluate(() =>
+ performance.getEntriesByType('resource').some(e => /drag-?drop-?touch/i.test(e.name)))
+ expect(polyfillLoaded, 'the drag-drop-touch polyfill stays off a tablet').toBe(false)
const row = page.locator('div[draggable]').filter({ hasText: 'Place 1' }).first()
await expect(row).toBeVisible()
const swipeSafe = await row.evaluate(el => el.getAttribute('draggable') !== 'true' || !!el.closest('[data-touch-drag]'))