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