/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/material/chips/testing/chip-edit-input-harness.ts
38 строк
1 KB
Kristiyan Kostadinov
fix(cdk/testing): make setContenteditableValue required (#32058)
13 окт 2025, 02:28
Не верифицирован
13 окт 2025, 02:28
544438c
Код
Авторство
О чём код?
/** * @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 {ChipEditInputHarnessFilters} from './chip-harness-filters'; /** Harness for interacting with an editable chip's input in tests. */ export class MatChipEditInputHarness extends ComponentHarness { static hostSelector = '.mat-chip-edit-input'; /** * Gets a `HarnessPredicate` that can be used to search for a chip edit input 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 MatChipEditInputHarness>( this: ComponentHarnessConstructor<T>, options: ChipEditInputHarnessFilters = {}, ): HarnessPredicate<T> { return new HarnessPredicate(this, options); } /** Sets the value of the input. */ async setValue(value: string): Promise<void> { const host = await this.host(); return host.setContenteditableValue(value); } }