material-web/switch/harness.ts
Elizabeth Mitchell 9694191ec0 feat(switch): add required and form validity
Swapped switch's interactive element back to an `<input>` to more easily support platform validation messages.

PiperOrigin-RevId: 559671594
2023-08-24 00:54:57 -07:00

20 lines
439 B
TypeScript

/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {Harness} from '../testing/harness.js';
import {Switch} from './internal/switch.js';
/**
* Test harness for switch elements.
*/
export class SwitchHarness extends Harness<Switch> {
protected override async getInteractiveElement() {
await this.element.updateComplete;
return this.element.renderRoot.querySelector('input')!;
}
}