Skip to content

Add tests for hover/focus parity on the primary button - #225

Merged
Baskarayelu merged 1 commit into
QuickLendX:mainfrom
greatest0fallt1me:test/115-hover-focus-parity-primary-button
Aug 28, 2026
Merged

Add tests for hover/focus parity on the primary button#225
Baskarayelu merged 1 commit into
QuickLendX:mainfrom
greatest0fallt1me:test/115-hover-focus-parity-primary-button

Conversation

@greatest0fallt1me

@greatest0fallt1me greatest0fallt1me commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

`app/globals.css`'s `.btn` only styled `:hover` (a lift transform). A keyboard user tabbing to the primary CTA ("Browse invoices" on the landing page) got no visible affordance beyond the browser's own default outline, while a mouse user hovering the same button saw the lift -- no parity between the two interaction modes.

Change

  • `app/globals.css`: added `.btn:focus-visible` with the same lift transform as `:hover`, plus an explicit `outline` (a transform alone isn't sufficient visible feedback for a11y -- `outline-style` must not be `none`).
  • `e2e/primary-button.spec.ts` (Playwright, new file): hover produces a transform change; focus produces the same transform as hover (parity); focus also shows a visible outline.

Note: could not execute the new e2e test locally

This repo's Playwright suite boots via `npm run build && npm run start`, and the production build currently fails on `main` for an unrelated, pre-existing reason: `lib/phone.ts` imports `libphonenumber-js`, which is not declared in `package.json` at all (confirmed via `npx tsc --noEmit` on a clean `main` checkout, and via the Playwright `webServer` failing with `Cannot find module 'libphonenumber-js'`). This blocks every e2e test in the suite, not just this one -- I did not fix it here since it's unrelated to #115's scope; flagging it in case it isn't already tracked. `npx tsc --noEmit` / `npx eslint` on the files this PR actually touches: clean.

Related to #115

app/globals.css only styled .btn:hover -- a keyboard user tabbing to
the primary CTA got no visible affordance at all, while a mouse user
hovering it did. Add a matching .btn:focus-visible rule (same lift
transform, plus a visible outline since a transform alone isn't
sufficient feedback for a11y) and Playwright tests asserting hover
and focus produce the same computed transform, and that focus shows
a visible outline.
@Baskarayelu
Baskarayelu merged commit 2990ba5 into QuickLendX:main Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants