test(e2e): measure the date-field wrapper for the 44px target sweep

The DateField/DateTimeField overlay input sits inside the wrapper's
border (~42px); the 44px tap target is the wrapper. Measure the closest
date-field wrapper so the sweep reflects the real affordance.
This commit is contained in:
Marc-André Bombeck committed 2026-06-26 14:35:40 +02:00
1 parent e366ebd8cf
commit 5411bb3e4c
1 file changed
+10 -1
+10 -1
View File
@@ -48,7 +48,16 @@ test.describe("Settings mobile consistency (Pixel 5)", () => {
)
.evaluateAll((els) =>
els.map((el) => {
const rect = el.getBoundingClientRect();
// DateField / DateTimeField front an sr-only native input with a
// formatted overlay; the 44px tap target is the wrapper, while the
// overlay sits inside the wrapper's border (≈42px). Measure the
// wrapper for any input inside one so the target-size reflects the
// real affordance, not the inner content box.
const wrapper = el.closest(
'[data-slot="date-field"],[data-slot="date-time-field"]',
);
const measured = wrapper ?? el;
const rect = measured.getBoundingClientRect();
const style = getComputedStyle(el);
return {
id: el.id || el.getAttribute("name") || "",