import {MatAccordionHarness} from '@angular/material/expansion/testing';
MatAccordionHarness
extends
ComponentHarness
Harness for interacting with a standard mat-accordion in tests.
Name | Description |
---|---|
|
async
getExpansionPanels
|
|
---|---|
Gets all expansion panels which are part of the accordion. |
|
Parameters | |
filter ExpansionPanelHarnessFilters = {}
|
|
Returns | |
Promise<MatExpansionPanelHarness[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isMulti
|
|
---|---|
Whether the accordion allows multiple expanded panels simultaneously. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options AccordionHarnessFilters = {}
|
Options for narrowing the search. |
Returns | |
HarnessPredicate<MatAccordionHarness>
|
a |
MatExpansionPanelHarness
extends
ContentContainerComponentHarness
Harness for interacting with a standard mat-expansion-panel in tests.
Name | Description |
---|---|
|
async
blur
|
|
---|---|
Blurs the panel. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
collapse
|
|
---|---|
Collapses the expansion panel if expanded. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
countHarnesses
|
|
---|---|
Returns the number of matching harnesses for the given query within the current harness's content. |
|
Parameters | |
query HarnessQuery<T>
|
The harness query to search for. |
Returns | |
Promise<number>
|
The number of matching harnesses for the given query. |
async
expand
|
|
---|---|
Expands the expansion panel if collapsed. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the panel. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAllChildLoaders
|
|
---|---|
Gets a list of |
|
Parameters | |
selector S
|
The selector for elements in the component's content. |
Returns | |
Promise<HarnessLoader[]>
|
A list of |
async
getAllHarnesses
|
|
---|---|
Gets all matching harnesses for the given query within the current harness's content. |
|
Parameters | |
query HarnessQuery<T>
|
The harness query to search for. |
Returns | |
Promise<T[]>
|
The list of harness matching the given query. |
async
getChildLoader
|
|
---|---|
Gets a |
|
Parameters | |
selector S
|
The selector for an element in the component's content. |
Returns | |
Promise<HarnessLoader>
|
A |
async
getDescription
|
|
---|---|
Gets the description text of the panel. |
|
Returns | |
Promise<string | null>
|
Description text or |
async
getHarness
|
|
---|---|
Gets the first matching harness for the given query within the current harness's content. |
|
Parameters | |
query HarnessQuery<T>
|
The harness query to search for. |
Returns | |
Promise<T>
|
The first harness matching the given query. |
async
getHarnessAtIndex
|
|
---|---|
Gets a matching harness for the given query and index within the current harness's content. |
|
Parameters | |
query HarnessQuery<T>
|
The harness query to search for. |
index number
|
The zero-indexed offset of the component to find. |
Returns | |
Promise<T>
|
The first harness matching the given query. |
async
getHarnessOrNull
|
|
---|---|
Gets the first matching harness for the given query within the current harness's content. |
|
Parameters | |
query HarnessQuery<T>
|
The harness query to search for. |
Returns | |
Promise<T | null>
|
The first harness matching the given query, or null if none is found. |
async
getTextContent
|
|
---|---|
Gets the text content of the panel. |
|
Returns | |
Promise<string>
|
|
async
getTitle
|
|
---|---|
Gets the title text of the panel. |
|
Returns | |
Promise<string | null>
|
Title text or |
async
getToggleIndicatorPosition
|
|
---|---|
Gets the position of the toggle indicator. |
|
Returns | |
Promise<'before' | 'after'>
|
|
async
hasHarness
|
|
---|---|
Checks whether there is a matching harnesses for the given query within the current harness's content. |
|
Parameters | |
query HarnessQuery<T>
|
The harness query to search for. |
Returns | |
Promise<boolean>
|
Whether there is matching harnesses for the given query. |
async
hasToggleIndicator
|
|
---|---|
Whether the panel has a toggle indicator displayed. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the panel is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isExpanded
|
|
---|---|
Whether the panel is expanded. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the panel is focused. |
|
Returns | |
Promise<boolean>
|
|
async
toggle
|
|
---|---|
Toggles the expanded state of the panel by clicking on the panel header. This method will not work if the panel is disabled. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options ExpansionPanelHarnessFilters = {}
|
Options for narrowing the search:
|
Returns | |
HarnessPredicate<MatExpansionPanelHarness>
|
a |
Deprecated
async
getHarnessLoaderForContent
|
|
---|---|
Gets a |
|
Returns | |
Promise<HarnessLoader>
|
|
AccordionHarnessFilters
ExpansionPanelHarnessFilters
Name | Description |
---|---|
|
|
|
|
|
|
|
|
|