diff --git a/e2e/domain-filter.spec.ts b/e2e/domain-filter.spec.ts index 7e81ca9..52e318a 100644 --- a/e2e/domain-filter.spec.ts +++ b/e2e/domain-filter.spec.ts @@ -398,9 +398,9 @@ test.describe('Domain Filter - Mobile Swipe', () => { await expect(page.getByRole('button', { name: /try again/i })).toBeVisible(); // Confirm the error UI is rendered inside the swipe viewer's container, - // not the desktop list's wrapper. Catches a regression that flips the - // viewport branch (e.g. an `isMobile` change leaking the desktop list - // into mobile viewports). + // not the desktop list's wrapper. Catches a regression that flips + // `useCanSwipe` — its width half or its pointer half — and leaks the + // desktop list into a phone. await expect(page.getByTestId('swipe-container')).toBeVisible(); }); diff --git a/e2e/fixtures/swipe-helpers.ts b/e2e/fixtures/swipe-helpers.ts index cedaf3f..5f94610 100644 --- a/e2e/fixtures/swipe-helpers.ts +++ b/e2e/fixtures/swipe-helpers.ts @@ -6,6 +6,20 @@ interface ActiveSwipeTextOptions { timeout?: number; } +/** + * Whether this page gets the swipe viewer, asked the way `useCanSwipe` asks it. + * + * A narrow viewport on its own stopped answering it: the viewer wants a finger + * too, so a desktop project only reaches it with `hasTouch`. + */ +export function mountsSwipeViewer(page: Page): Promise { + return page.evaluate( + () => + !matchMedia('(min-width: 48rem)').matches && + matchMedia('(pointer: coarse) and (hover: none)').matches, + ); +} + /** * Wait for swipe container to be ready with multiple panels. * Verifies container visibility, minimum panel count, rendered dimensions, diff --git a/e2e/header-overflow.spec.ts b/e2e/header-overflow.spec.ts index ab6a06d..8772c3c 100644 --- a/e2e/header-overflow.spec.ts +++ b/e2e/header-overflow.spec.ts @@ -123,11 +123,11 @@ test.describe('Header overflow — More dropdown', () => { const showItem = page.getByRole('menuitem', { name: 'show' }); await expect(showItem).toBeVisible(); await showItem.click(); - // On this viewport SwipeStoryViewer mounts for /show and immediately - // replaces the URL with /item/:firstShowId (objectID 99999 in the - // mock) — racing Playwright's first poll. Same pattern as the - // domain-filter URL assertion. Either form is a pass: both prove - // navigation reached the show feed. + // Either form is a pass: both prove navigation reached the show feed. + // Which one shows up is the project's pointer, not this test's business — + // a touch project mounts SwipeStoryViewer, which replaces the URL with + // /item/:firstShowId (objectID 99999 in the mock) faster than Playwright's + // first poll; a mouse gets the list at 320px and stays on /#/show. await expect(page).toHaveURL(/#\/(show|item\/99999)/); }); diff --git a/e2e/layout-tokens.spec.ts b/e2e/layout-tokens.spec.ts index 790b04b..e4684fc 100644 --- a/e2e/layout-tokens.spec.ts +++ b/e2e/layout-tokens.spec.ts @@ -149,3 +149,81 @@ test.describe('--network-bar-height', () => { await expectChromeTokenToMatch(page, '--network-bar-height', '.network-status-bar'); }); }); + +// The one place that paints the viewer's markup without the viewer: while it +// decides story-or-comment, the panel is on screen and pads for the header +// itself. React has to know that, or `
` reserves the header a second time +// and the skeleton starts a whole header below the story that replaces it. +test.describe('the chrome under a panel with no viewer yet', () => { + test.use({ viewport: { width: 412, height: 839 }, hasTouch: true }); + + test('is reserved once, by the panel', async ({ page }) => { + await setupApiMocks(page); + // Hold the type lookup open: the window is one round trip otherwise. + await page.route('**/v0/item/12345.json*', async route => { + await new Promise(resolve => setTimeout(resolve, 3000)); + await route.fallback(); + }); + + await page.goto('/#/item/12345'); + await expect(page.getByTestId('swipe-panel')).toBeVisible(); + + const { contentTop, headerBottom } = await page.evaluate(() => { + const panel = document.querySelector('.swipe-snap-panel.active')!; + return { + contentTop: panel.firstElementChild!.getBoundingClientRect().top, + headerBottom: document.querySelector('.app-header')!.getBoundingClientRect().bottom, + }; + }); + + expect(contentTop).toBeCloseTo(headerBottom, 0); + }); +}); + +// The list tree's half of the same sum. `
` reserves both fixed bars for +// whatever page is below it, and each reservation is the token the panels use — +// not a second number that lands near it, which is what `pt-14` was: 3px of +// slack, and the only hand-written chrome offset left in the app. +// +// Only reachable below `md:`, where the header is fixed. Above it the header is +// in flow, `md:pt-0` applies, and the sum is trivially exact — which is why the +// desktop centring test never saw this. +test.describe('the chrome around a list on a narrow viewport', () => { + test.use({ viewport: { width: 412, height: 839 }, hasTouch: true }); + + test('reserves exactly the header it sits under', async ({ page }) => { + await setupApiMocks(page); + // The profile is the page a phone gets in the list tree; a mouse gets every + // page there, at any width under `md:`. + await page.goto('/#/user/pg'); + await expect(page.getByRole('heading', { level: 1, name: 'pg' })).toBeVisible(); + + // The reservation against the thing reserved, rather than against where the + // first child happens to start — a margin there would be nobody's bug. + const { reserved, header } = await page.evaluate(() => ({ + reserved: parseFloat(getComputedStyle(document.querySelector('main')!).paddingTop), + header: document.querySelector('.app-header')!.getBoundingClientRect().height, + })); + + expect(reserved).toBeCloseTo(header, 0); + }); + + test('leaves a full-page state fitting the viewport exactly', async ({ page, context }) => { + await setupApiMocks(page); + await page.goto('/#/no-such-route'); + await expect(page.getByText('Lost in the feed')).toBeVisible(); + // Offline so all three terms are non-zero: the state sizes itself as the + // viewport less both tokens, so it fits only if both of `
`'s + // reservations are those same tokens. This is what the 3px cost — a page + // written to fit, scrolling. + await setOfflineAndWaitForBar(page, context); + + await expect + .poll(() => + page.evaluate( + () => document.documentElement.scrollHeight - document.documentElement.clientHeight, + ), + ) + .toBeLessThanOrEqual(1); + }); +}); diff --git a/e2e/mobile-breakpoint.spec.ts b/e2e/mobile-breakpoint.spec.ts new file mode 100644 index 0000000..00767be --- /dev/null +++ b/e2e/mobile-breakpoint.spec.ts @@ -0,0 +1,244 @@ +import { test, expect, type Page } from '@playwright/test'; +import { setupApiMocks } from './fixtures/api-mocks'; +import { + emulateBrowserFontSize, + enlargeRootFont, + setOfflineAndWaitForBar, +} from './fixtures/layout-helpers'; +import { waitForSwipeReady } from './fixtures/swipe-helpers'; + +// Two questions live here, and they used to be one. +// +// `useIsMobileLayout` is shape: how much chrome fits, asked in `md:`'s own +// 48rem so the answer cannot disagree with the styles around it. It used to ask +// 767px, which only equals 48rem at a 16px root. +// +// `useCanSwipe` is which tree mounts, and it wants a finger as well, because +// the swipe viewer binds touch and nothing else — no keys, no wheel, no +// buttons. Width alone put mouse readers in it: by a narrowed window, or by a +// default font size large enough to make 48rem wider than their screen. +// +// The tree is read off the URL: the swipe viewer rewrites `/` to the story it +// lands on, and the list leaves it alone. + +const TOP_STORY_TITLE = 'Rust Is the Future of JavaScript Infrastructure'; +// The viewer rewrites `/` to the story it lands on; the list leaves it alone. +const ITEM_URL = /\/#\/item\/\d+/; + +const reservation = (page: Page) => + page.evaluate(() => ({ + main: getComputedStyle(document.querySelector('main')!).paddingBottom, + panel: getComputedStyle( + document.querySelector('.swipe-snap-panel.active') ?? document.body, + ).paddingBottom, + bar: getComputedStyle(document.documentElement) + .getPropertyValue('--network-bar-height') + .trim(), + })); + +const mdMatches = (page: Page) => + page.evaluate(() => ({ + md: matchMedia('(min-width: 48rem)').matches, + px: matchMedia('(min-width: 768px)').matches, + })); + +test.describe('A 900px viewport at a 24px default font — with a finger', () => { + test.use({ viewport: { width: 900, height: 800 }, hasTouch: true }); + + test('is mobile on both counts, and mounts the viewer', async ({ page, browserName }) => { + test.skip(browserName !== 'chromium', 'only Chromium can emulate the setting'); + await emulateBrowserFontSize(page, 24); + await setupApiMocks(page); + await page.goto('/#/'); + + // Without this window there is nothing for the assertion below to catch: + // 48rem is 1152px here, so only the old px query would have said desktop. + expect( + await mdMatches(page), + 'this viewport no longer sits between the rem and px md breakpoints', + ).toEqual({ md: false, px: true }); + + await page.waitForURL(ITEM_URL, { timeout: 10_000 }); + await waitForSwipeReady(page); + }); + + test('reserves the bar inside its panels, not around the flow', async ({ + page, + context, + browserName, + }) => { + test.skip(browserName !== 'chromium', 'only Chromium can emulate the setting'); + await emulateBrowserFontSize(page, 24); + await setupApiMocks(page); + await page.goto('/#/'); + await page.waitForURL(ITEM_URL, { timeout: 10_000 }); + // `--network-bar-height` is 0 until the bar is up, so nothing below this + // line would mean anything without it. + await setOfflineAndWaitForBar(page, context); + + // Padding the flow as well would strand an empty strip under a feed that + // has already made room inside the panel the reader is on. + const { main, panel, bar } = await reservation(page); + expect(bar).not.toBe('0px'); + expect(panel).toBe(bar); + expect(main).toBe('0px'); + }); +}); + +test.describe('A 900px viewport at a 24px default font — with a mouse', () => { + test.use({ viewport: { width: 900, height: 800 } }); + // A phone project's finger is baked in at the project level, and this is the + // other device class — the one width alone used to misfile. + test.skip(({ hasTouch }) => hasTouch, 'needs a pointer that can hover'); + + test('gets the mobile header and the list it can actually drive', async ({ + page, + browserName, + }) => { + test.skip(browserName !== 'chromium', 'only Chromium can emulate the setting'); + await emulateBrowserFontSize(page, 24); + await setupApiMocks(page); + await page.goto('/#/'); + + // Same side of the line as the test above — this is the reader #249 would + // otherwise have handed a viewer with no way forward: a low-vision desktop + // reader on a large default font, whose 900px window is under 48rem. + expect(await mdMatches(page)).toEqual({ md: false, px: true }); + + // Shape followed the width: `md:` reveals the pill icons, and it agrees. + await expect(page.locator('header nav a svg').first()).not.toBeVisible(); + + // The tree followed the pointer. + await expect(page.getByTestId('swipe-container')).toHaveCount(0); + expect(page.url()).not.toMatch(ITEM_URL); + + // And it goes somewhere, which was the whole complaint. + await page.getByText('137 comments').first().click(); + await expect(page).toHaveURL(ITEM_URL); + await expect(page.getByRole('link', { name: TOP_STORY_TITLE }).first()).toBeVisible(); + }); + + test('keeps the strip the list would otherwise scroll under', async ({ + page, + context, + browserName, + }) => { + test.skip(browserName !== 'chromium', 'only Chromium can emulate the setting'); + await emulateBrowserFontSize(page, 24); + await setupApiMocks(page); + await page.goto('/#/'); + await expect(page.getByRole('link', { name: TOP_STORY_TITLE }).first()).toBeVisible(); + await setOfflineAndWaitForBar(page, context); + + // Whoever answers this has to answer for the tree, not the width: a width + // query skips a list mounted below `md:` and hides its last row behind the + // bar, which is where this rule used to live. + await expect + .poll(async () => { + const { main, bar } = await reservation(page); + return { main, bar, reserved: bar !== '0px' && main === bar }; + }) + .toMatchObject({ reserved: true }); + }); +}); + +test.describe('Where the rem line falls, either way', () => { + test.use({ viewport: { width: 900, height: 800 } }); + + test('a root font size set in CSS moves neither question', async ({ page }) => { + // `rem` in a media query is the browser's default, not the root element, + // so `html { font-size: 24px }` leaves `md:` where it was — and the hook + // has to ignore it too, or it would draw mobile chrome in desktop styling. + await enlargeRootFont(page, 24); + await setupApiMocks(page); + await page.goto('/#/'); + + expect( + await page.evaluate(() => ({ + root: getComputedStyle(document.documentElement).fontSize, + md: matchMedia('(min-width: 48rem)').matches, + })), + ).toEqual({ root: '24px', md: true }); + + await expect(page.getByRole('link', { name: TOP_STORY_TITLE }).first()).toBeVisible(); + expect(page.url()).not.toMatch(ITEM_URL); + }); + + test('a 12px default font puts a 620px viewport on the desktop side', async ({ + page, + browserName, + }) => { + test.skip(browserName !== 'chromium', 'only Chromium can emulate the setting'); + await emulateBrowserFontSize(page, 12); + await setupApiMocks(page); + await page.setViewportSize({ width: 620, height: 800 }); + await page.goto('/#/'); + + // The mirror of the first: 48rem is 576px here, so the px query is the + // one that would have said mobile. + expect( + await mdMatches(page), + 'this viewport no longer sits between the rem and px md breakpoints', + ).toEqual({ md: true, px: false }); + + await expect(page.getByRole('link', { name: TOP_STORY_TITLE }).first()).toBeVisible(); + expect(page.url()).not.toMatch(ITEM_URL); + + // And the header pays for what it draws: this is the band where `md:` put + // an icon in every pill that the packer had reserved nothing for. + await expect(page.locator('header nav a svg').first()).toBeVisible(); + }); +}); + +// index.html guesses the tree before React exists, to keep the first paint from +// carrying the other layout's scrollbar. A guess in different terms than the +// hook's is a guess that can be wrong, so it asks both of the same questions — +// and these tests hold it to that by cutting the app's own scripts, leaving the +// inline one as the only thing that could have added the class. +test.describe('The first paint, before React', () => { + test.describe('with a finger', () => { + test.use({ viewport: { width: 375, height: 667 }, hasTouch: true }); + + test('bets on swipe mode', async ({ page }) => { + await page.route('**/*.js', route => route.abort()); + await page.goto('/#/', { waitUntil: 'domcontentloaded' }); + + expect( + await page.evaluate(() => document.documentElement.classList.contains('swipe-mode')), + ).toBe(true); + }); + }); + + test.describe('with a finger, on a viewport only rem calls narrow', () => { + test.use({ viewport: { width: 900, height: 800 }, hasTouch: true }); + + test('bets on it there too', async ({ page, browserName }) => { + test.skip(browserName !== 'chromium', 'only Chromium can emulate the setting'); + await emulateBrowserFontSize(page, 24); + await page.route('**/*.js', route => route.abort()); + await page.goto('/#/', { waitUntil: 'domcontentloaded' }); + + // 48rem is 1152px at this setting, so `innerWidth < 768` said no here and + // handed the viewer a first paint with the list's scrollbar in it. + expect( + await page.evaluate(() => document.documentElement.classList.contains('swipe-mode')), + ).toBe(true); + }); + }); + + test.describe('with a mouse', () => { + test.use({ viewport: { width: 375, height: 667 } }); + test.skip(({ hasTouch }) => hasTouch, 'needs a pointer that can hover'); + + test('does not, however narrow the window', async ({ page }) => { + await page.route('**/*.js', route => route.abort()); + await page.goto('/#/', { waitUntil: 'domcontentloaded' }); + + // The old `innerWidth < 768` would have said yes here, then watched + // React mount a list into styling written for the viewer. + expect( + await page.evaluate(() => document.documentElement.classList.contains('swipe-mode')), + ).toBe(false); + }); + }); +}); diff --git a/e2e/navigation.spec.ts b/e2e/navigation.spec.ts index e30024f..ecf7823 100644 --- a/e2e/navigation.spec.ts +++ b/e2e/navigation.spec.ts @@ -1,13 +1,16 @@ import { test, expect, type Page } from '@playwright/test'; import { setupApiMocks } from './fixtures/api-mocks'; -import { getActiveSwipePanel, waitForScrollAtIndex, waitForSwipeReady } from './fixtures/swipe-helpers'; +import { + getActiveSwipePanel, + mountsSwipeViewer, + waitForScrollAtIndex, + waitForSwipeReady, +} from './fixtures/swipe-helpers'; const TOP_STORY_TITLE = 'Rust Is the Future of JavaScript Infrastructure'; async function expectTopStoryVisible(page: Page) { - const isMobileViewport = (page.viewportSize()?.width ?? 1280) < 768; - - if (isMobileViewport) { + if (await mountsSwipeViewer(page)) { await waitForSwipeReady(page, 1); await waitForScrollAtIndex(page, 0); await expect( @@ -16,6 +19,10 @@ async function expectTopStoryVisible(page: Page) { return; } + // A headline is a visible link in either tree, so this branch has to say + // which one it is in — otherwise a wrong answer above just quietly drops the + // panel waits and every assertion still passes. + await expect(page.getByTestId('swipe-container')).toHaveCount(0); await expect( page.getByRole('link', { name: TOP_STORY_TITLE }).first(), ).toBeVisible({ timeout: 10_000 }); @@ -32,8 +39,7 @@ test.describe('Navigation', () => { // On mobile, the swipe viewer auto-rewrites / → /item/. Wait for // this replace-navigation to complete so the subsequent click isn't // swallowed by WebKit during the transition (Mobile Safari flake). - const isMobile = (page.viewportSize()?.width ?? 1280) < 768; - if (isMobile) { + if (await mountsSwipeViewer(page)) { await page.waitForURL(/\/#\/item\/\d+/, { timeout: 10000 }); } @@ -56,8 +62,7 @@ test.describe('Navigation', () => { await page.goto('/#/'); // Same mobile stabilization as Show HN test above. - const isMobile = (page.viewportSize()?.width ?? 1280) < 768; - if (isMobile) { + if (await mountsSwipeViewer(page)) { await page.waitForURL(/\/#\/item\/\d+/, { timeout: 10000 }); } @@ -124,8 +129,9 @@ test.describe('Navigation', () => { test('navigates back to Top from other section', async ({ page }) => { await page.goto('/#/show'); + const isMobile = await mountsSwipeViewer(page); + // On mobile, wait for the show swipe-rewrite to settle before clicking. - const isMobile = (page.viewportSize()?.width ?? 1280) < 768; if (isMobile) { await page.waitForURL(/\/#\/item\/\d+/, { timeout: 10000 }); } @@ -159,7 +165,7 @@ test.describe('Navigation', () => { await page.goto('/#/'); await expectTopStoryVisible(page); - const isMobile = (page.viewportSize()?.width ?? 1280) < 768; + const isMobile = await mountsSwipeViewer(page); const bestLink = page.getByRole('link', { name: /best/i }); await bestLink.scrollIntoViewIfNeeded(); @@ -191,7 +197,7 @@ test.describe('Navigation', () => { }); test.describe('Navigation - Header Visibility', () => { - test.use({ viewport: { width: 375, height: 667 } }); + test.use({ viewport: { width: 375, height: 667 }, hasTouch: true }); test.beforeEach(async ({ page }) => { await setupApiMocks(page); @@ -206,6 +212,11 @@ test.describe('Navigation - Header Visibility', () => { }); test.describe('Navigation - Viewport Resize Transition', () => { + // The transition under test is the width one, so hand the desktop projects a + // finger: without it these viewports are a narrowed window, which now keeps + // the list on purpose. + test.use({ hasTouch: true }); + test.beforeEach(async ({ page }) => { await setupApiMocks(page); }); diff --git a/e2e/network-status-bar.spec.ts b/e2e/network-status-bar.spec.ts index 3e54568..199b26b 100644 --- a/e2e/network-status-bar.spec.ts +++ b/e2e/network-status-bar.spec.ts @@ -8,7 +8,8 @@ import { } from './fixtures/layout-helpers'; test.describe('Network Status Bar - Viewport Switch', () => { - test.use({ viewport: { width: 1280, height: 720 } }); + // Resizes into swipe mode, which takes a finger as well as a narrow window. + test.use({ viewport: { width: 1280, height: 720 }, hasTouch: true }); test.beforeEach(async ({ page }) => { await setupApiMocks(page); @@ -59,7 +60,8 @@ test.describe('Network Status Bar - Viewport Switch', () => { await context.setOffline(true); await expect(page.getByText('No internet connection')).toBeVisible({ timeout: 5000 }); - // Resize triggers swipe mode via the breakpoint hook. + // Narrowing crosses `useCanSwipe`'s width half; the finger the describe + // declares is the other half. await page.setViewportSize({ width: 375, height: 667 }); await page.waitForTimeout(500); diff --git a/e2e/touch-feel.spec.ts b/e2e/touch-feel.spec.ts index 7211fba..5ee638a 100644 --- a/e2e/touch-feel.spec.ts +++ b/e2e/touch-feel.spec.ts @@ -6,10 +6,12 @@ import { waitForSwipeReady } from './fixtures/swipe-helpers'; // that reloads the feed, selection handles eating a drag — and which nothing else // in the suite would notice disappearing. -const MOBILE = { width: 390, height: 780 }; +// A finger as well as a narrow viewport: the swipe viewer asks for both, so a +// narrowed desktop window is a desktop list and has none of this to defend. +const PHONE = { viewport: { width: 390, height: 780 }, hasTouch: true } as const; test.describe('Overscroll containment', () => { - test.use({ viewport: MOBILE }); + test.use(PHONE); test.beforeEach(async ({ page }) => { await setupApiMocks(page); @@ -55,7 +57,7 @@ test.describe('Overscroll containment', () => { }); test.describe('The gate iOS puts in front of :active', () => { - test.use({ viewport: MOBILE }); + test.use(PHONE); test('a passive touchstart listener is registered on the document', async ({ page, @@ -87,13 +89,11 @@ test.describe('The gate iOS puts in front of :active', () => { }); test.describe('Selection during a horizontal drag', () => { - test.use({ viewport: MOBILE }); + test.use(PHONE); test('a finger cannot start one on a text post headline, though its body still can', async ({ page, - hasTouch, }) => { - test.skip(!hasTouch, 'the lock is gated on a coarse pointer'); await setupApiMocks(page); // The Ask fixture carries `url: null`, so its title renders as bare text // instead of a link — the case where a long press raised the handles rather @@ -122,25 +122,6 @@ test.describe('Selection during a horizontal drag', () => { expect(fromHeadline, 'the headline must not be selectable').toBe(''); }); - // The mirror of the test above: same headline, same double-click, opposite - // expectation. The lock exists to keep a long press off a swipe, and a mouse - // has no swipe to take, so it must not pay for one. - test('a mouse keeps that headline selectable', async ({ page, hasTouch }) => { - test.skip(hasTouch, 'a device with a finger has a gesture to protect'); - await setupApiMocks(page); - await page.goto('/#/item/88888'); - await waitForSwipeReady(page); - - const headline = page.locator('.swipe-snap-panel.active h1').first(); - - await expect - .poll(async () => { - await headline.dblclick(); - return page.evaluate(() => window.getSelection()?.toString().length ?? 0); - }, { message: 'the headline must stay selectable for a mouse' }) - .toBeGreaterThan(0); - }); - test('a live selection is collapsed when the gesture locks horizontal', async ({ page }) => { await setupApiMocks(page); await page.goto('/#/'); @@ -212,3 +193,27 @@ test.describe('Selection during a horizontal drag', () => { expect(collapsedAtLock).toBe(true); }); }); + +// The mirror of the headline test above, and it has to look elsewhere for its +// headline: a mouse reader never reaches a swipe panel now, so the page whose +// selection they could lose is the desktop item page. Nothing there is behind +// the coarse-pointer rules, which is the point — this fails if they escape it. +test.describe('Selection with a mouse', () => { + test.use({ viewport: { width: 1280, height: 720 } }); + test.skip(({ hasTouch }) => hasTouch, 'a device with a finger has a gesture to protect'); + + test('a headline stays selectable on the page a mouse is given', async ({ page }) => { + await setupApiMocks(page); + await page.goto('/#/item/88888'); + + const headline = page.getByRole('heading', { level: 1 }).first(); + await expect(headline).toBeVisible(); + + await expect + .poll(async () => { + await headline.dblclick(); + return page.evaluate(() => window.getSelection()?.toString().length ?? 0); + }, { message: 'the headline must stay selectable for a mouse' }) + .toBeGreaterThan(0); + }); +}); diff --git a/e2e/user-submissions.spec.ts b/e2e/user-submissions.spec.ts index ac31bf8..efd36ca 100644 --- a/e2e/user-submissions.spec.ts +++ b/e2e/user-submissions.spec.ts @@ -284,8 +284,8 @@ test.describe('User Submissions - Mobile Swipe', () => { await expect(page.getByRole('button', { name: /try again/i })).toBeVisible(); // Confirm the error UI is rendered inside the swipe viewer's container, - // not the desktop list's wrapper. Catches a regression that flips the - // viewport branch. + // not the desktop list's wrapper. Catches a regression that flips + // `useCanSwipe`, on either of the two questions it asks. await expect(page.getByTestId('swipe-container')).toBeVisible(); }); }); diff --git a/index.html b/index.html index 939b38f..a41b8f4 100644 --- a/index.html +++ b/index.html @@ -100,13 +100,15 @@