mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
test(e2e): exempt visually-hidden inputs from the 44px target sweep
DateField and DateTimeField front an sr-only native date input with a formatted overlay carrying the 44px target, matching the file-upload pattern the sweep already exempts. Generalise the exemption to any visually-hidden or zero-size input.
This commit is contained in:
1 parent
e818178be8
commit
e366ebd8cf
1 file changed
+9
-11
@@ -64,17 +64,15 @@ test.describe("Settings mobile consistency (Pixel 5)", () => {
|
||||
}),
|
||||
)
|
||||
).filter(
|
||||
// The avatar profile-photo upload uses the accessible
|
||||
// visually-hidden <input type="file"> pattern: the input itself
|
||||
// is sr-only / zero-size and the real 44 px touch target is the
|
||||
// styled label/button that triggers it. The touch-target sweep
|
||||
// must measure that visible affordance, not the hidden input, so
|
||||
// exempt file inputs that are hidden or collapsed to zero size.
|
||||
(inp) =>
|
||||
!(
|
||||
inp.type === "file" &&
|
||||
(inp.hidden || inp.height === 0 || inp.width === 0)
|
||||
),
|
||||
// Some inputs use the accessible visually-hidden pattern: the input
|
||||
// itself is sr-only / zero-size and the real 44 px touch target is a
|
||||
// sibling visible affordance — the styled label/button for the avatar
|
||||
// <input type="file">, and the formatted overlay that fronts the
|
||||
// sr-only native <input type="date"|"datetime-local"> inside DateField /
|
||||
// DateTimeField. The touch-target sweep must measure those visible
|
||||
// affordances, not the hidden input, so exempt any input that is
|
||||
// visually hidden or collapsed to zero size.
|
||||
(inp) => !(inp.hidden || inp.height === 0 || inp.width === 0),
|
||||
);
|
||||
|
||||
expect(formInputs.length).toBeGreaterThan(0);
|
||||
|
||||
Reference in new issue
Block a user