9 lines
349 B
TypeScript
9 lines
349 B
TypeScript
// Inspector a11y helper: verify input ↔ helptext wiring via aria-describedby
|
|
import { expect } from 'vitest'
|
|
|
|
export function assertDescribedBy(input: HTMLElement, helpId: string) {
|
|
expect(input).toHaveAttribute('aria-describedby', helpId)
|
|
const help = (input.ownerDocument || document).getElementById(helpId)
|
|
expect(help).not.toBeNull()
|
|
}
|