import {MatButtonToggleHarness} from '@angular/material/button-toggle/testing';
MatButtonToggleHarness
extends
ComponentHarness
Harness for interacting with a standard mat-button-toggle in tests.
async
blur
|
|
---|---|
Blurs the toggle. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
check
|
|
---|---|
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
|
|
---|---|
Focuses the toggle. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAppearance
|
|
---|---|
Gets the appearance that the button toggle is using. |
|
Returns | |
Promise<MatButtonToggleAppearance>
|
|
async
getAriaLabel
|
|
---|---|
Gets a promise for the button toggle's aria-label. |
|
Returns | |
Promise<string | null>
|
|
async
getAriaLabelledby
|
|
---|---|
Gets a promise for the button toggles's aria-labelledby. |
|
Returns | |
Promise<string | null>
|
|
async
getName
|
|
---|---|
Gets a promise for the button toggle's name. |
|
Returns | |
Promise<string | null>
|
|
async
getText
|
|
---|---|
Gets a promise for the button toggle's text. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isChecked
|
|
---|---|
Gets a boolean promise indicating if the button toggle is checked. |
|
Returns | |
Promise<boolean>
|
|
async
isDisabled
|
|
---|---|
Gets a boolean promise indicating if the button toggle is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
toggle
|
|
---|---|
Toggle the checked state of the buttons toggle. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
uncheck
|
|
---|---|
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. |
MatButtonToggleGroupHarness
extends
ComponentHarness
Harness for interacting with a standard mat-button-toggle in tests.
async
getAppearance
|
|
---|---|
Gets the appearance that the group is using. |
|
Returns | |
Promise<MatButtonToggleAppearance>
|
|
async
getToggles
|
|
---|---|
Gets the button toggles that are inside the group. |
|
Parameters | |
filter ButtonToggleHarnessFilters = {}
|
Optionally filters which toggles are included. |
Returns | |
Promise<MatButtonToggleHarness[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Gets whether the button toggle group is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isVertical
|
|
---|---|
Gets whether the button toggle group is laid out vertically. |
|
Returns | |
Promise<boolean>
|
|
ButtonToggleHarnessFilters
Criteria that can be used to filter a list of MatButtonToggleHarness
instances.
Name | Description |
---|---|
|
Only find instances that are checked. |
|
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.