import {MatButtonToggleHarness} from '@angular/material/button-toggle/testing';
MatButtonToggleHarness
extends
ComponentHarness
Harness for interacting with a standard mat-button-toggle in tests.
| Name | Description |
|---|---|
|
The selector for the host element of a |
async
blur
(): Promise<void>
|
|
|---|---|
|
Blurs the toggle. |
|
| Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
check
(): Promise<void>
|
|
|---|---|
|
Puts the button toggle in a checked state by toggling it if it's currently unchecked, or doing nothing if it is already checked. |
|
| Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
(): Promise<void>
|
|
|---|---|
|
Focuses the toggle. |
|
| Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAppearance
(): Promise<MatButtonToggleAppearance>
|
|
|---|---|
|
Gets the appearance that the button toggle is using. |
|
| Returns | |
Promise<MatButtonToggleAppearance>
|
|
async
getAriaLabel
(): Promise<string | null>
|
|
|---|---|
|
Gets a promise for the button toggle's aria-label. |
|
| Returns | |
Promise<string | null>
|
|
async
getAriaLabelledby
(): Promise<string | null>
|
|
|---|---|
|
Gets a promise for the button toggles's aria-labelledby. |
|
| Returns | |
Promise<string | null>
|
|
async
getName
(): Promise<string | null>
|
|
|---|---|
|
Gets a promise for the button toggle's name. |
|
| Returns | |
Promise<string | null>
|
|
async
getText
(): Promise<string>
|
|
|---|---|
|
Gets a promise for the button toggle's text. |
|
| Returns | |
Promise<string>
|
|
async
host
(): Promise<TestElement>
|
|
|---|---|
|
Gets a |
|
| Returns | |
Promise<TestElement>
|
|
async
isChecked
(): Promise<boolean>
|
|
|---|---|
|
Gets a boolean promise indicating if the button toggle is checked. |
|
| Returns | |
Promise<boolean>
|
|
async
isDisabled
(): Promise<boolean>
|
|
|---|---|
|
Gets a boolean promise indicating if the button toggle is disabled. |
|
| Returns | |
Promise<boolean>
|
|
async
isFocused
(): Promise<boolean>
|
|
|---|---|
|
Whether the toggle is focused. |
|
| Returns | |
Promise<boolean>
|
|
async
toggle
(): Promise<void>
|
|
|---|---|
|
Toggle the checked state of the buttons toggle. |
|
| Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
uncheck
(): Promise<void>
|
|
|---|---|
|
Puts the button toggle in an unchecked state by toggling it if it's currently checked, or doing nothing if it's already unchecked. |
|
| Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
(options:
ButtonToggleHarnessFilters = {}): HarnessPredicate<MatButtonToggleHarness>
|
|
|---|---|
|
Gets a |
|
| Parameters | |
|
options ButtonToggleHarnessFilters = {}
|
Options for filtering which button toggle instances are considered a match. |
| Returns | |
HarnessPredicate<MatButtonToggleHarness>
|
a |
MatButtonToggleGroupHarness
extends
ComponentHarness
Harness for interacting with a standard mat-button-toggle in tests.
| Name | Description |
|---|---|
|
The selector for the host element of a |
async
getAppearance
(): Promise<MatButtonToggleAppearance>
|
|
|---|---|
|
Gets the appearance that the group is using. |
|
| Returns | |
Promise<MatButtonToggleAppearance>
|
|
async
getToggles
(filter:
ButtonToggleHarnessFilters = {}): Promise<MatButtonToggleHarness[]>
|
|
|---|---|
|
Gets the button toggles that are inside the group. |
|
| Parameters | |
|
filter ButtonToggleHarnessFilters = {}
|
Optionally filters which toggles are included. |
| Returns | |
Promise<MatButtonToggleHarness[]>
|
|
async
host
(): Promise<TestElement>
|
|
|---|---|
|
Gets a |
|
| Returns | |
Promise<TestElement>
|
|
async
isDisabled
(): Promise<boolean>
|
|
|---|---|
|
Gets whether the button toggle group is disabled. |
|
| Returns | |
Promise<boolean>
|
|
async
isVertical
(): Promise<boolean>
|
|
|---|---|
|
Gets whether the button toggle group is laid out vertically. |
|
| Returns | |
Promise<boolean>
|
|
static
with
(options:
ButtonToggleGroupHarnessFilters = {}): HarnessPredicate<MatButtonToggleGroupHarness>
|
|
|---|---|
|
Gets a |
|
| Parameters | |
|
options ButtonToggleGroupHarnessFilters = {}
|
Options for filtering which button toggle instances are considered a match. |
| Returns | |
HarnessPredicate<MatButtonToggleGroupHarness>
|
a |
ButtonToggleHarnessFilters
Criteria that can be used to filter a list of MatButtonToggleHarness instances.
| Name | Description |
|---|---|
|
Only find instances that are checked. |
|
Only find instances which match the given disabled state. |
|
Only find instances whose name matches the given value. |
|
Only find instances whose text matches the given value. |
ButtonToggleGroupHarnessFilters
Criteria that can be used to filter a list of MatButtonToggleGroupHarness instances.
| Name | Description |
|---|---|
|
Only find instances which match the given disabled state. |