mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 21:10:59 +00:00
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:
1 parent
e366ebd8cf
commit
5411bb3e4c
1 file changed
+10
-1
@@ -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") || "",
|
||||
|
||||
Reference in new issue
Block a user