fix(web): preserve per-row aria-labels through RowActionsMenu + test fixes
CI vitest run on3f8a2c5surfaced 17 failures across 5 test files; this commit addresses 15 that are this batch's responsibility. 1. RowActionsMenu now accepts ariaLabel on RowAction. Defaults to label. Admin pages (requests/quarantine/users) pass per-row aria-labels matching the pre-batch buttons ("Approve Geogaddi", "Resolve Roygbiv", "Make alice admin", etc.) so screen readers + tests find them. 2. PlayerBar.test.ts — anchored regex /^(play|pause)$/i so the new "Player options" overflow ⋮ doesn't also match /play|pause/i. 3. MobileNavDrawer.test.ts — added vi.mock for $app/state, $app/navigation, and $lib/auth/store.svelte (mirrors Shell.test.ts pattern). Without these, SvelteKit's notifiable_store helper isn't bootstrapped in vitest and the suite fails to load. The 2 remaining vitest failures are in /admin/integrations Save flow (putLidarrConfig spy not called). Untouched by this batch and the recent "Save runs Test first" refactor (bca8622) appears related — flagging for operator verification, not chasing as a regression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -238,6 +238,7 @@
|
||||
{@const primary: RowAction = {
|
||||
icon: u.is_admin ? ShieldOff : Shield,
|
||||
label: u.is_admin ? 'Remove admin' : 'Make admin',
|
||||
ariaLabel: u.is_admin ? `Remove admin from ${u.username}` : `Make ${u.username} admin`,
|
||||
onclick: () => onToggleAdmin(u),
|
||||
disabled: saving
|
||||
}}
|
||||
@@ -245,18 +246,23 @@
|
||||
{
|
||||
icon: u.auto_approve_requests ? XCircle : CheckCircle2,
|
||||
label: u.auto_approve_requests ? 'Disable auto-approve' : 'Enable auto-approve',
|
||||
ariaLabel: u.auto_approve_requests
|
||||
? `Disable auto-approve for ${u.username}`
|
||||
: `Enable auto-approve for ${u.username}`,
|
||||
onclick: () => onToggleAutoApprove(u),
|
||||
disabled: saving
|
||||
},
|
||||
{
|
||||
icon: KeyRound,
|
||||
label: 'Reset password',
|
||||
ariaLabel: `Reset password for ${u.username}`,
|
||||
onclick: () => { resetPasswordTarget = u; },
|
||||
disabled: saving
|
||||
},
|
||||
{
|
||||
icon: Trash2,
|
||||
label: 'Delete',
|
||||
ariaLabel: `Delete ${u.username}`,
|
||||
onclick: () => { confirmDeleteTarget = u; },
|
||||
disabled: saving,
|
||||
danger: true
|
||||
|
||||
Reference in New Issue
Block a user