diff --git a/e2e/hydration.spec.ts b/e2e/hydration.spec.ts index cba05f0..7e82bac 100644 --- a/e2e/hydration.spec.ts +++ b/e2e/hydration.spec.ts @@ -119,13 +119,20 @@ test.describe('Hydration Tests', () => { const buttonCount = await buttons.count(); if (buttonCount > 0) { - const firstButton = buttons.first(); - await expect(firstButton).toBeVisible(); - - // Try clicking (should not throw) - await firstButton.click().catch(() => { - // Some buttons might be disabled, that's OK - }); + // Find a visible interactive element (desktop hides some mobile-only buttons) + let clicked = false; + for (let i = 0; i < Math.min(buttonCount, 25); i++) { + const candidate = buttons.nth(i); + // eslint-disable-next-line no-await-in-loop + if (await candidate.isVisible()) { + await candidate.click().catch(() => { + // Some buttons might be disabled or covered, that's OK + }); + clicked = true; + break; + } + } + expect(clicked).toBe(true); } }); });