import {MatCheckboxHarness} from '@angular/material/checkbox/testing';
MatCheckboxHarness
extends
ComponentHarness
Harness for interacting with a standard mat-checkbox in tests.
async
blur
|
|
---|---|
Blurs the checkbox. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
check
|
|
---|---|
Puts the checkbox in a checked state by toggling it if it is currently unchecked, or doing nothing if it is already checked. Note: This attempts to check the checkbox as a user would, by clicking it. Therefore if you
are using |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the checkbox. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAriaLabel
|
|
---|---|
Gets the checkbox's aria-label. |
|
Returns | |
Promise<string | null>
|
|
async
getAriaLabelledby
|
|
---|---|
Gets the checkbox's aria-labelledby. |
|
Returns | |
Promise<string | null>
|
|
async
getLabelText
|
|
---|---|
Gets the checkbox's label text. |
|
Returns | |
Promise<string>
|
|
async
getName
|
|
---|---|
Gets the checkbox's name. |
|
Returns | |
Promise<string | null>
|
|
async
getValue
|
|
---|---|
Gets the checkbox's value. |
|
Returns | |
Promise<string | null>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isChecked
|
|
---|---|
Whether the checkbox is checked. |
|
Returns | |
Promise<boolean>
|
|
async
isDisabled
|
|
---|---|
Whether the checkbox is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isIndeterminate
|
|
---|---|
Whether the checkbox is in an indeterminate state. |
|
Returns | |
Promise<boolean>
|
|
async
isRequired
|
|
---|---|
Whether the checkbox is required. |
|
Returns | |
Promise<boolean>
|
|
async
isValid
|
|
---|---|
Whether the checkbox is valid. |
|
Returns | |
Promise<boolean>
|
|
async
toggle
|
|
---|---|
Toggles the checked state of the checkbox. Note: This attempts to toggle the checkbox as a user would, by clicking it. Therefore if you
are using |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
uncheck
|
|
---|---|
Puts the checkbox in an unchecked state by toggling it if it is currently checked, or doing nothing if it is already unchecked. Note: This attempts to uncheck the checkbox as a user would, by clicking it. Therefore if you
are using |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
CheckboxHarnessFilters
A set of criteria that can be used to filter a list of MatCheckboxHarness
instances.
Name | Description |
---|---|
|
Only find instances whose label matches the given value. |
|
Only find instances whose name attribute is the given value. |