import {MatAutocompleteHarness} from '@angular/material/autocomplete/testing';
MatAutocompleteHarness
extends
ComponentHarness
Harness for interacting with a standard mat-autocomplete in tests.
async
blur
|
|
---|---|
Blurs the autocomplete input. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
enterText
|
|
---|---|
Enters text into the autocomplete. |
|
Parameters | |
value string
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the autocomplete input. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getOptionGroups
|
|
---|---|
Gets the option groups inside the autocomplete panel. |
|
Parameters | |
filters Pick<OptgroupHarnessFilters, "selector" | "labelText"> = {}
|
|
Returns | |
Promise<MatOptgroupHarness[]>
|
|
async
getOptions
|
|
---|---|
Gets the options inside the autocomplete panel. |
|
Parameters | |
filters Pick<OptionHarnessFilters, "text" | "isSelected" | "selector"> = {}
|
|
Returns | |
Promise<MatOptionHarness[]>
|
|
async
getValue
|
|
---|---|
Gets the value of the autocomplete input. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the autocomplete input is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isOpen
|
|
---|---|
Whether the autocomplete is open. |
|
Returns | |
Promise<boolean>
|
|
async
selectOption
|
|
---|---|
Selects the first option matching the given filters. |
|
Parameters | |
filters OptionHarnessFilters
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
AutocompleteHarnessFilters
A set of criteria that can be used to filter a list of MatAutocompleteHarness
instances.
Name | Description |
---|---|
|
Only find instances whose associated input element matches the given value. |