mirror of
https://github.com/material-components/material-web.git
synced 2024-09-21 10:38:19 +03:00
0949b075e5
PiperOrigin-RevId: 460551614
32 lines
853 B
TypeScript
32 lines
853 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2022 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {Harness} from '@material/web/testing/harness';
|
|
import {NavigationTabHarness} from 'google3/third_party/javascript/material/web/navigationtab/harness';
|
|
|
|
import {NavigationBar} from './lib/navigation-bar';
|
|
|
|
/**
|
|
* Test harness for navigation bars.
|
|
*/
|
|
export class NavigationBarHarness extends Harness<NavigationBar> {
|
|
readonly tab = this.getTab();
|
|
|
|
/**
|
|
* Returns the active tab to be used for interaction simulation.
|
|
*/
|
|
protected override async getInteractiveElement() {
|
|
await this.element.updateComplete;
|
|
return (await this.tab).getInteractiveElement();
|
|
}
|
|
|
|
protected async getTab() {
|
|
await this.element.updateComplete;
|
|
const tab = this.element.tabs[this.element.activeIndex];
|
|
return new NavigationTabHarness(tab);
|
|
}
|
|
}
|