test(e2e): the text-preview legs wait for the document, not just the card, before acting on it (BUG-3247) (#1601)

The Lightbox renders `.lightbox-text-scroll` while the text loader is still
`loading` (Lightbox.svelte ~2698), and openMarkdown waited only for that card.
When the body was late, the scroll leg's single wheel landed on an empty,
unscrollable card and scrollTop stayed 0 (2 first-attempt failures in 82 CI E2E
jobs). openMarkdown now waits for `.lightbox-text-body`, which exists only in
the `ready` phase, and the scroll leg asserts its premise that the card
overflows.

Control: the text body fetch delayed 1.5s by a route fails the scroll leg 10/10
with CI's signature without the wait, and passes 10/10 with it. Unforced, the
whole spec x40 at 8 workers passes 160/160.

Claude-Session: https://claude.ai/code/session_01NidgPePY7UvHcEJCMkD2Qz
This commit is contained in:
xarmian
2026-09-27 02:12:13 -04:00
committed by GitHub
parent 48360170e1
commit 69272256cd
+5
View File
@@ -61,6 +61,9 @@ test.describe('attachment viewer — text preview (IDEA-2712)', () => {
await page.goto(itemUrl(fixture, doc.slug));
await page.locator(TILE).first().click();
await expect(page.locator(TEXT_CARD)).toBeVisible();
// The card is on screen while the body is still LOADING (BUG-3247): wait
// for the document, or a leg can act on an empty, unscrollable card.
await expect(page.locator(TEXT_RENDERED)).toBeVisible();
}
test('renders the markdown, through the shared pipeline', async ({ page, fixture, request }) => {
@@ -111,6 +114,8 @@ test.describe('attachment viewer — text preview (IDEA-2712)', () => {
}));
const before = await behind();
expect(await card.evaluate((el) => el.scrollTop)).toBe(0);
// PREMISE: there is something to scroll.
expect(await card.evaluate((el) => el.scrollHeight > el.clientHeight), 'the card does not overflow').toBe(true);
await card.hover();
await page.mouse.wheel(0, 600);