material-web/iconbutton/harness.ts
Andrew Jakubowicz 38b1b69a9c fix(iconbutton)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/iconbutton/lib` to `@material/web/iconbutton/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550579461
2023-07-24 09:10:22 -07:00

24 lines
548 B
TypeScript

/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {Harness} from '../testing/harness.js';
import {IconButton} from './internal/icon-button.js';
/**
* Test harness for icon buttons.
*/
export class IconButtonHarness extends Harness<IconButton> {
protected override async getInteractiveElement() {
await this.element.updateComplete;
if (this.element.href) {
return this.element.renderRoot.querySelector('a')!;
}
return this.element.renderRoot.querySelector('button')!;
}
}