2022-08-01 17:44:10 +03:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright 2022 Google LLC
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-10-18 19:28:12 +03:00
|
|
|
import {Harness} from '../testing/harness.js';
|
2022-08-01 17:44:10 +03:00
|
|
|
|
2022-08-24 21:00:50 +03:00
|
|
|
import {List} from './lib/list.js';
|
|
|
|
import {ListItemHarness} from './lib/listitem/harness.js';
|
2022-08-01 17:44:10 +03:00
|
|
|
|
2023-03-30 09:11:02 +03:00
|
|
|
export {ListItemHarness} from './lib/listitem/harness.js';
|
|
|
|
|
2022-08-01 17:44:10 +03:00
|
|
|
/**
|
|
|
|
* Test harness for list.
|
|
|
|
*/
|
|
|
|
export class ListHarness extends Harness<List> {
|
2022-08-02 15:04:32 +03:00
|
|
|
/**
|
|
|
|
* Returns the first list item element.
|
|
|
|
*/
|
|
|
|
protected override async getInteractiveElement() {
|
|
|
|
await this.element.updateComplete;
|
|
|
|
return (await this.getItems())[0].getInteractiveElement();
|
|
|
|
}
|
|
|
|
|
2022-08-01 17:44:10 +03:00
|
|
|
/** @return List item harnesses. */
|
|
|
|
getItems() {
|
|
|
|
return this.element.items.map((item) => new ListItemHarness(item));
|
|
|
|
}
|
|
|
|
}
|