import {MatAutocompleteHarness} from '@angular/material/autocomplete/testing';
MatAutocompleteHarness
Harness for interacting with a standard mat-autocomplete in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
blur
|
|
---|---|
Blurs the autocomplete input. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
clear
|
|
---|---|
Clears the input value. |
|
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? Omit<OptionGroupFilters, "ancestor">
|
|
Returns | |
Promise<OptionGroup[]>
|
|
async
getOptions
|
|
---|---|
Gets the options inside the autocomplete panel. |
|
Parameters | |
filters? Omit<OptionFilters, "ancestor">
|
|
Returns | |
Promise<Option[]>
|
|
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
isFocused
|
|
---|---|
Whether the autocomplete input is focused. |
|
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 OptionFilters
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options AutocompleteHarnessFilters = {}
|
Options for filtering which autocomplete instances are considered a match. |
Returns | |
HarnessPredicate<MatAutocompleteHarness>
|
a |
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. |