import {MatChipListHarness} from '@angular/material/chips/testing';
MatChipListHarness
Harness for interacting with a standard chip list in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
getChips
|
|
---|---|
Gets the list of chips inside the chip list. |
|
Parameters | |
filter ChipHarnessFilters = {}
|
Optionally filters which chips are included. |
Returns | |
Promise<MatChipHarness[]>
|
|
async
getInput
|
|
---|---|
Gets the |
|
Parameters | |
filter ChipInputHarnessFilters = {}
|
Optionally filters which chip input is included. |
Returns | |
Promise<MatChipInputHarness>
|
|
getOrientation | |
---|---|
Gets whether the orientation of the chip list. |
|
Returns | |
Promise<'horizontal' | 'vertical'>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Gets whether the chip list is disabled. |
|
Returns | |
Promise<boolean>
|
|
isInvalid | |
---|---|
Gets whether the chip list is invalid. |
|
Returns | |
Promise<boolean>
|
|
isMultiple | |
---|---|
Gets whether the chip list is in multi selection mode. |
|
Returns | |
Promise<boolean>
|
|
isRequired | |
---|---|
Gets whether the chip list is required. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ChipListHarnessFilters = {}
|
Options for filtering which chip list instances are considered a match. |
Returns | |
HarnessPredicate<MatChipListHarness>
|
a |
Deprecated
async
selectChips
|
|
---|---|
Selects a chip inside the chip list. |
|
Parameters | |
filter ChipHarnessFilters = {}
|
An optional filter to apply to the child chips. All the chips matching the filter will be selected. |
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
MatChipHarness
extends
ContentContainerComponentHarness
Harness for interacting with a standard selectable Angular Material chip in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getAvatar
|
|
---|---|
Gets the avatar inside a chip. |
|
Parameters | |
filter ChipAvatarHarnessFilters = {}
|
Optionally filters which avatars are included. |
Returns | |
Promise<MatChipAvatarHarness | null>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getHarnessOrNull
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T | null>
|
|
async
getRemoveButton
|
|
---|---|
Gets the remove button inside of a chip. |
|
Parameters | |
filter ChipRemoveHarnessFilters = {}
|
Optionally filters which remove buttons are included. |
Returns | |
Promise<MatChipRemoveHarness>
|
|
async
getText
|
|
---|---|
Gets the text of the chip. |
|
Returns | |
Promise<string>
|
|
async
hasHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the chip is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
remove
|
|
---|---|
Removes the given chip. Only applies if it's removable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ChipHarnessFilters = {}
|
Options for filtering which chip instances are considered a match. |
Returns | |
HarnessPredicate<MatChipHarness>
|
a |
Deprecated
async
deselect
|
|
---|---|
Deselects the given chip. Only applies if it's selectable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
Deprecated
async
isSelected
|
|
---|---|
Whether the chip is selected. |
|
Returns | |
Promise<boolean>
|
|
Deprecated
async
select
|
|
---|---|
Selects the given chip. Only applies if it's selectable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
Deprecated
async
toggle
|
|
---|---|
Toggles the selected state of the given chip. Only applies if it's selectable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
MatChipInputHarness
extends
ComponentHarness
Harness for interacting with a standard Material chip inputs in tests.
Name | Description |
---|---|
|
async
blur
|
|
---|---|
Blurs the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getPlaceholder
|
|
---|---|
Gets the placeholder of the input. |
|
Returns | |
Promise<string>
|
|
async
getValue
|
|
---|---|
Gets the value of the input. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the input is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the input is focused. |
|
Returns | |
Promise<boolean>
|
|
async
isRequired
|
|
---|---|
Whether the input is required. |
|
Returns | |
Promise<boolean>
|
|
async
sendSeparatorKey
|
|
---|---|
Sends a chip separator key to the input element. |
|
Parameters | |
key string | TestKey
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
setValue
|
|
---|---|
Sets the value of the input. The value will be set by simulating keypresses that correspond to the given value. |
|
Parameters | |
newValue string
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ChipInputHarnessFilters = {}
|
Options for filtering which input instances are considered a match. |
Returns | |
HarnessPredicate<MatChipInputHarness>
|
a |
MatChipRemoveHarness
extends
ComponentHarness
Harness for interacting with a standard Material chip remove button in tests.
Name | Description |
---|---|
|
async
click
|
|
---|---|
Clicks the remove button. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ChipRemoveHarnessFilters = {}
|
Options for filtering which input instances are considered a match. |
Returns | |
HarnessPredicate<MatChipRemoveHarness>
|
a |
MatChipOptionHarness
extends
MatChipHarness
Name | Description |
---|---|
|
The selector for the host element of a selectable chip instance. |
async
deselect
|
|
---|---|
Deselects the given chip. Only applies if it's selectable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader[]>
|
|
async
getAllHarnesses
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T[]>
|
|
async
getAvatar
|
|
---|---|
Gets the avatar inside a chip. |
|
Parameters | |
filter ChipAvatarHarnessFilters = {}
|
Optionally filters which avatars are included. |
Returns | |
Promise<MatChipAvatarHarness | null>
|
|
async
getChildLoader
|
|
---|---|
Parameters | |
selector S
|
|
Returns | |
Promise<HarnessLoader>
|
|
async
getHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T>
|
|
async
getHarnessOrNull
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<T | null>
|
|
async
getRemoveButton
|
|
---|---|
Gets the remove button inside of a chip. |
|
Parameters | |
filter ChipRemoveHarnessFilters = {}
|
Optionally filters which remove buttons are included. |
Returns | |
Promise<MatChipRemoveHarness>
|
|
async
getText
|
|
---|---|
Gets the text of the chip. |
|
Returns | |
Promise<string>
|
|
async
hasHarness
|
|
---|---|
Parameters | |
query HarnessQuery<T>
|
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the chip is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isSelected
|
|
---|---|
Whether the chip is selected. |
|
Returns | |
Promise<boolean>
|
|
async
remove
|
|
---|---|
Removes the given chip. Only applies if it's removable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
select
|
|
---|---|
Selects the given chip. Only applies if it's selectable. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
toggle
|
|
---|---|
Toggles the selected state of the given chip. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ChipOptionHarnessFilters = {}
|
Options for filtering which chip instances are considered a match. |
Returns | |
HarnessPredicate<MatChipOptionHarness>
|
a |
MatChipListboxHarness
Harness for interacting with a standard selectable chip list in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
getChips
|
|
---|---|
Gets the list of chips inside the chip list. |
|
Parameters | |
filter ChipOptionHarnessFilters = {}
|
Optionally filters which chips are included. |
Returns | |
Promise<MatChipOptionHarness[]>
|
|
getOrientation | |
---|---|
Gets whether the orientation of the chip list. |
|
Returns | |
Promise<'horizontal' | 'vertical'>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Gets whether the chip list is disabled. |
|
Returns | |
Promise<boolean>
|
|
isInvalid | |
---|---|
Gets whether the chip list is invalid. |
|
Returns | |
Promise<boolean>
|
|
isMultiple | |
---|---|
Gets whether the chip list is in multi selection mode. |
|
Returns | |
Promise<boolean>
|
|
isRequired | |
---|---|
Gets whether the chip list is required. |
|
Returns | |
Promise<boolean>
|
|
async
selectChips
|
|
---|---|
Selects a chip inside the chip list. |
|
Parameters | |
filter ChipOptionHarnessFilters = {}
|
An optional filter to apply to the child chips. All the chips matching the filter will be selected. |
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ChipListboxHarnessFilters = {}
|
Options for filtering which chip list instances are considered a match. |
Returns | |
HarnessPredicate<MatChipListboxHarness>
|
a |
ChipHarnessFilters
A set of criteria that can be used to filter a list of chip instances.
Name | Description |
---|---|
|
Only find instances whose text matches the given value. |
Deprecated
|
Only find chip instances whose selected state matches the given value. |
ChipOptionHarnessFilters
A set of criteria that can be used to filter a list of selectable chip instances.
Name | Description |
---|---|
|
Only find chip instances whose selected state matches the given value. |
ChipListHarnessFilters
A set of criteria that can be used to filter chip list instances.
ChipListboxHarnessFilters
A set of criteria that can be used to filter selectable chip list instances.
ChipInputHarnessFilters
A set of criteria that can be used to filter a list of MatChipListInputHarness
instances.
Name | Description |
---|---|
|
Filters based on the placeholder text of the input. |
|
Filters based on the value of the input. |
ChipRemoveHarnessFilters
A set of criteria that can be used to filter a list of MatChipRemoveHarness
instances.
ChipAvatarHarnessFilters
A set of criteria that can be used to filter a list of MatChipAvatarHarness
instances.