1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
---|
9 | import { MatButtonToggleAppearance } from '@angular/material/button-toggle';
|
---|
10 | import { ButtonToggleHarnessFilters } from './button-toggle-harness-filters';
|
---|
11 | /** Harness for interacting with a standard mat-button-toggle in tests. */
|
---|
12 | export declare class MatButtonToggleHarness extends ComponentHarness {
|
---|
13 | /** The selector for the host element of a `MatButton` instance. */
|
---|
14 | static hostSelector: string;
|
---|
15 | private _label;
|
---|
16 | private _button;
|
---|
17 | /**
|
---|
18 | * Gets a `HarnessPredicate` that can be used to search for a `MatButtonToggleHarness` that meets
|
---|
19 | * certain criteria.
|
---|
20 | * @param options Options for filtering which button toggle instances are considered a match.
|
---|
21 | * @return a `HarnessPredicate` configured with the given options.
|
---|
22 | */
|
---|
23 | static with(options?: ButtonToggleHarnessFilters): HarnessPredicate<MatButtonToggleHarness>;
|
---|
24 | /** Gets a boolean promise indicating if the button toggle is checked. */
|
---|
25 | isChecked(): Promise<boolean>;
|
---|
26 | /** Gets a boolean promise indicating if the button toggle is disabled. */
|
---|
27 | isDisabled(): Promise<boolean>;
|
---|
28 | /** Gets a promise for the button toggle's name. */
|
---|
29 | getName(): Promise<string | null>;
|
---|
30 | /** Gets a promise for the button toggle's aria-label. */
|
---|
31 | getAriaLabel(): Promise<string | null>;
|
---|
32 | /** Gets a promise for the button toggles's aria-labelledby. */
|
---|
33 | getAriaLabelledby(): Promise<string | null>;
|
---|
34 | /** Gets a promise for the button toggle's text. */
|
---|
35 | getText(): Promise<string>;
|
---|
36 | /** Gets the appearance that the button toggle is using. */
|
---|
37 | getAppearance(): Promise<MatButtonToggleAppearance>;
|
---|
38 | /** Focuses the toggle. */
|
---|
39 | focus(): Promise<void>;
|
---|
40 | /** Blurs the toggle. */
|
---|
41 | blur(): Promise<void>;
|
---|
42 | /** Whether the toggle is focused. */
|
---|
43 | isFocused(): Promise<boolean>;
|
---|
44 | /** Toggle the checked state of the buttons toggle. */
|
---|
45 | toggle(): Promise<void>;
|
---|
46 | /**
|
---|
47 | * Puts the button toggle in a checked state by toggling it if it's
|
---|
48 | * currently unchecked, or doing nothing if it is already checked.
|
---|
49 | */
|
---|
50 | check(): Promise<void>;
|
---|
51 | /**
|
---|
52 | * Puts the button toggle in an unchecked state by toggling it if it's
|
---|
53 | * currently checked, or doing nothing if it's already unchecked.
|
---|
54 | */
|
---|
55 | uncheck(): Promise<void>;
|
---|
56 | }
|
---|