material-web/radio/harness.ts
Elizabeth Mitchell 0711f8c03c fix(radio): make host radio role to fix a11y
Why? role="radio" items need to be in the same DOM scope to properly announce "radio X of X" and not "radio 1 of 1"

PiperOrigin-RevId: 559908996
2023-08-24 16:46:01 -07:00

20 lines
395 B
TypeScript

/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {Harness} from '../testing/harness.js';
import {Radio} from './internal/radio.js';
/**
* Test harness for radio.
*/
export class RadioHarness extends Harness<Radio> {
override async getInteractiveElement() {
await this.element.updateComplete;
return this.element as HTMLElement;
}
}