/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/material/chips/testing/chip-edit-harness.ts
37 строк
1 KB
Andrey Dolgachev
feat(material/chips): add (optional) edit icon to input chips (#31041)
30 май 2025, 22:06
Не верифицирован
30 май 2025, 22:06
2438454
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { ComponentHarness, ComponentHarnessConstructor, HarnessPredicate, } from '@angular/cdk/testing'; import {ChipEditHarnessFilters} from './chip-harness-filters'; /** Harness for interacting with a standard Material chip edit button in tests. */ export class MatChipEditHarness extends ComponentHarness { static hostSelector = '.mat-mdc-chip-edit'; /** * Gets a `HarnessPredicate` that can be used to search for a chip edit with specific * attributes. * @param options Options for filtering which input instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with<T extends MatChipEditHarness>( this: ComponentHarnessConstructor<T>, options: ChipEditHarnessFilters = {}, ): HarnessPredicate<T> { return new HarnessPredicate(this, options); } /** Clicks the edit button. */ async click(): Promise<void> { return (await this.host()).click(); } }