import {MatTabGroupHarness} from '@angular/material/tabs/testing';
MatTabGroupHarness
extends
ComponentHarness
Harness for interacting with a mat-tab-group in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
getSelectedTab
|
|
---|---|
Gets the selected tab of the tab group. |
|
Returns | |
Promise<MatTabHarness>
|
|
async
getTabs
|
|
---|---|
Gets the list of tabs in the tab group. |
|
Parameters | |
filter TabHarnessFilters = {}
|
Optionally filters which tabs are included. |
Returns | |
Promise<MatTabHarness[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
selectTab
|
|
---|---|
Selects a tab in this tab group. |
|
Parameters | |
filter TabHarnessFilters = {}
|
An optional filter to apply to the child tabs. The first tab matching the filter will be selected. |
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options TabGroupHarnessFilters = {}
|
Options for filtering which tab group instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatTabHarness
extends
ContentContainerComponentHarness
Harness for interacting with an Angular Material tab 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
getAriaLabel
|
|
---|---|
Gets the aria-label of the tab. |
|
Returns | |
Promise<string | null>
|
|
async
getAriaLabelledby
|
|
---|---|
Gets the value of the "aria-labelledby" attribute. |
|
Returns | |
Promise<string | null>
|
|
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
getLabel
|
|
---|---|
Gets the label of the tab. |
|
Returns | |
Promise<string>
|
|
async
getRootHarnessLoader
|
|
---|---|
Returns | |
Promise<HarnessLoader>
|
|
async
getTextContent
|
|
---|---|
Gets the text content of the tab. |
|
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>
|
|
async
isDisabled
|
|
---|---|
Whether the tab is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isSelected
|
|
---|---|
Whether the tab is selected. |
|
Returns | |
Promise<boolean>
|
|
async
select
|
|
---|---|
Selects the given tab by clicking on the label. Tab cannot be selected if disabled. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options TabHarnessFilters = {}
|
Options for filtering which tab instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatTabNavBarHarness
extends
ComponentHarness
Harness for interacting with a mat-tab-nav-bar in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
clickLink
|
|
---|---|
Clicks a link inside the nav bar. |
|
Parameters | |
filter TabLinkHarnessFilters = {}
|
An optional filter to apply to the child link. The first link matching the filter will be clicked. |
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getActiveLink
|
|
---|---|
Gets the active link in the nav bar. |
|
Returns | |
Promise<MatTabLinkHarness>
|
|
async
getLinks
|
|
---|---|
Gets the list of links in the nav bar. |
|
Parameters | |
filter TabLinkHarnessFilters = {}
|
Optionally filters which links are included. |
Returns | |
Promise<MatTabLinkHarness[]>
|
|
async
getPanel
|
|
---|---|
Gets the panel associated with the nav bar. |
|
Returns | |
Promise<MatTabNavPanelHarness>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options TabNavBarHarnessFilters = {}
|
Options for filtering which tab nav bar instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
MatTabLinkHarness
extends
ComponentHarness
Harness for interacting with a Angular Material tab link in tests.
Name | Description |
---|---|
|
The selector for the host element of a |
async
click
|
|
---|---|
Clicks on the link. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getLabel
|
|
---|---|
Gets the label of the link. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isActive
|
|
---|---|
Whether the link is active. |
|
Returns | |
Promise<boolean>
|
|
async
isDisabled
|
|
---|---|
Whether the link is disabled. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options TabLinkHarnessFilters = {}
|
Options for filtering which tab link instances are considered a match. |
Returns | |
HarnessPredicate<T>
|
a |
TabHarnessFilters
A set of criteria that can be used to filter a list of MatTabHarness
instances.
Name | Description |
---|---|
|
Only find instances whose label matches the given value. |
|
Only find instances whose selected state matches the given value. |
TabGroupHarnessFilters
A set of criteria that can be used to filter a list of MatTabGroupHarness
instances.
Name | Description |
---|---|
|
Only find instances whose selected tab label matches the given value. |
TabLinkHarnessFilters
A set of criteria that can be used to filter a list of MatTabLinkHarness
instances.
Name | Description |
---|---|
|
Only find instances whose label matches the given value. |
TabNavBarHarnessFilters
A set of criteria that can be used to filter a list of MatTabNavBarHarness
instances.
TabNavPanelHarnessFilters
A set of criteria that can be used to filter a list of MatTabNavPanelHarness
instances.