import {MatCardHarness} from '@angular/material/card/testing';
MatCardHarness
extends
ContentContainerComponentHarness
Harness for interacting with a mat-card in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
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
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
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
getSubtitleText
|
|
---|---|
Gets the cards's subtitle text. |
|
Returns | |
Promise<string>
|
|
async
getText
|
|
---|---|
Gets all of the card's content as text. |
|
Returns | |
Promise<string>
|
|
async
getTitleText
|
|
---|---|
Gets the cards's title text. |
|
Returns | |
Promise<string>
|
|
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
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options CardHarnessFilters = {}
|
Options for filtering which card instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
CardHarnessFilters
A set of criteria that can be used to filter a list of MatCardHarness
instances.
Name | Description |
---|---|
|
Only find instances whose subtitle matches the given value. |
|
Only find instances whose text matches the given value. |
|
Only find instances whose title matches the given value. |