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 { AsyncFactoryFn, ComponentHarness, HarnessPredicate, TestElement } from '@angular/cdk/testing';
|
---|
9 | import { CheckboxHarnessFilters } from './checkbox-harness-filters';
|
---|
10 | export declare abstract class _MatCheckboxHarnessBase extends ComponentHarness {
|
---|
11 | protected abstract _input: AsyncFactoryFn<TestElement>;
|
---|
12 | protected abstract _label: AsyncFactoryFn<TestElement>;
|
---|
13 | /** Whether the checkbox is checked. */
|
---|
14 | isChecked(): Promise<boolean>;
|
---|
15 | /** Whether the checkbox is in an indeterminate state. */
|
---|
16 | isIndeterminate(): Promise<boolean>;
|
---|
17 | /** Whether the checkbox is disabled. */
|
---|
18 | isDisabled(): Promise<boolean>;
|
---|
19 | /** Whether the checkbox is required. */
|
---|
20 | isRequired(): Promise<boolean>;
|
---|
21 | /** Whether the checkbox is valid. */
|
---|
22 | isValid(): Promise<boolean>;
|
---|
23 | /** Gets the checkbox's name. */
|
---|
24 | getName(): Promise<string | null>;
|
---|
25 | /** Gets the checkbox's value. */
|
---|
26 | getValue(): Promise<string | null>;
|
---|
27 | /** Gets the checkbox's aria-label. */
|
---|
28 | getAriaLabel(): Promise<string | null>;
|
---|
29 | /** Gets the checkbox's aria-labelledby. */
|
---|
30 | getAriaLabelledby(): Promise<string | null>;
|
---|
31 | /** Gets the checkbox's label text. */
|
---|
32 | getLabelText(): Promise<string>;
|
---|
33 | /** Focuses the checkbox. */
|
---|
34 | focus(): Promise<void>;
|
---|
35 | /** Blurs the checkbox. */
|
---|
36 | blur(): Promise<void>;
|
---|
37 | /** Whether the checkbox is focused. */
|
---|
38 | isFocused(): Promise<boolean>;
|
---|
39 | /**
|
---|
40 | * Toggles the checked state of the checkbox.
|
---|
41 | *
|
---|
42 | * Note: This attempts to toggle the checkbox as a user would, by clicking it. Therefore if you
|
---|
43 | * are using `MAT_CHECKBOX_DEFAULT_OPTIONS` to change the behavior on click, calling this method
|
---|
44 | * might not have the expected result.
|
---|
45 | */
|
---|
46 | abstract toggle(): Promise<void>;
|
---|
47 | /**
|
---|
48 | * Puts the checkbox in a checked state by toggling it if it is currently unchecked, or doing
|
---|
49 | * nothing if it is already checked.
|
---|
50 | *
|
---|
51 | * Note: This attempts to check the checkbox as a user would, by clicking it. Therefore if you
|
---|
52 | * are using `MAT_CHECKBOX_DEFAULT_OPTIONS` to change the behavior on click, calling this method
|
---|
53 | * might not have the expected result.
|
---|
54 | */
|
---|
55 | check(): Promise<void>;
|
---|
56 | /**
|
---|
57 | * Puts the checkbox in an unchecked state by toggling it if it is currently checked, or doing
|
---|
58 | * nothing if it is already unchecked.
|
---|
59 | *
|
---|
60 | * Note: This attempts to uncheck the checkbox as a user would, by clicking it. Therefore if you
|
---|
61 | * are using `MAT_CHECKBOX_DEFAULT_OPTIONS` to change the behavior on click, calling this method
|
---|
62 | * might not have the expected result.
|
---|
63 | */
|
---|
64 | uncheck(): Promise<void>;
|
---|
65 | }
|
---|
66 | /** Harness for interacting with a standard mat-checkbox in tests. */
|
---|
67 | export declare class MatCheckboxHarness extends _MatCheckboxHarnessBase {
|
---|
68 | /** The selector for the host element of a `MatCheckbox` instance. */
|
---|
69 | static hostSelector: string;
|
---|
70 | /**
|
---|
71 | * Gets a `HarnessPredicate` that can be used to search for a `MatCheckboxHarness` that meets
|
---|
72 | * certain criteria.
|
---|
73 | * @param options Options for filtering which checkbox instances are considered a match.
|
---|
74 | * @return a `HarnessPredicate` configured with the given options.
|
---|
75 | */
|
---|
76 | static with(options?: CheckboxHarnessFilters): HarnessPredicate<MatCheckboxHarness>;
|
---|
77 | protected _input: AsyncFactoryFn<TestElement>;
|
---|
78 | protected _label: AsyncFactoryFn<TestElement>;
|
---|
79 | private _inputContainer;
|
---|
80 | toggle(): Promise<void>;
|
---|
81 | }
|
---|