From 0891effd68b211fde964736f0723a94eba70ce46 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Wed, 21 Oct 2026 18:04:02 +0800 Subject: [PATCH] test(web): probe locale dialog scroll container Anchor the desktop-locale overflow probe to the locale selector's nearest horizontal scroll container instead of nav's next sibling. Master moved the settings header between nav and options, so the old positional target put the probe in a fixed header row and the negative control could not overflow. --- apps/web/tests/desktop-locale.e2e.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/web/tests/desktop-locale.e2e.ts b/apps/web/tests/desktop-locale.e2e.ts index 71590956e9..95010bd4f4 100644 --- a/apps/web/tests/desktop-locale.e2e.ts +++ b/apps/web/tests/desktop-locale.e2e.ts @@ -109,13 +109,19 @@ describe.skipIf(MODE === 'record')('web e2e: native and Client locale preference return containers.filter(element => element.clientWidth > 0 && element.scrollWidth > element.clientWidth + 1).length }) await expect.poll(overflows).toBe(0) - await jaDialog.evaluate((dialog) => { - const options = dialog.querySelector('nav')!.nextElementSibling!.lastElementChild! + await jaDialog.getByRole('button', { name: '日本語', exact: true }).evaluate((button) => { + const dialog = button.closest('[role="dialog"]') + let container: HTMLElement | null = button.parentElement + while (container !== null && container !== dialog + && !['auto', 'scroll'].includes(getComputedStyle(container).overflowX)) { + container = container.parentElement + } + if (container === null || container === dialog) throw new Error('locale selector has no horizontal scroll container') const probe = document.createElement('div') probe.dataset.localeOverflowProbe = '' probe.style.width = '2000px' probe.style.height = '1px' - options.append(probe) + container.append(probe) }) try { expect(await overflows()).toBeGreaterThan(0)