/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; /** Harness for interacting with a standard mat-button-toggle in tests. */ export class MatButtonToggleHarness extends ComponentHarness { constructor() { super(...arguments); this._label = this.locatorFor('.mat-button-toggle-label-content'); this._button = this.locatorFor('.mat-button-toggle-button'); } /** The selector for the host element of a `MatButton` instance. */ static { this.hostSelector = '.mat-button-toggle'; } /** * Gets a `HarnessPredicate` that can be used to search for a `MatButtonToggleHarness` that meets * certain criteria. * @param options Options for filtering which button toggle instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(MatButtonToggleHarness, options) .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text)) .addOption('name', options.name, (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name)) .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) === checked) .addOption('disabled', options.disabled, async (harness, disabled) => { return (await harness.isDisabled()) === disabled; }); } /** Gets a boolean promise indicating if the button toggle is checked. */ async isChecked() { const checked = (await this._button()).getAttribute('aria-pressed'); return coerceBooleanProperty(await checked); } /** Gets a boolean promise indicating if the button toggle is disabled. */ async isDisabled() { const disabled = (await this._button()).getAttribute('disabled'); return coerceBooleanProperty(await disabled); } /** Gets a promise for the button toggle's name. */ async getName() { return (await this._button()).getAttribute('name'); } /** Gets a promise for the button toggle's aria-label. */ async getAriaLabel() { return (await this._button()).getAttribute('aria-label'); } /** Gets a promise for the button toggles's aria-labelledby. */ async getAriaLabelledby() { return (await this._button()).getAttribute('aria-labelledby'); } /** Gets a promise for the button toggle's text. */ async getText() { return (await this._label()).text(); } /** Gets the appearance that the button toggle is using. */ async getAppearance() { const host = await this.host(); const className = 'mat-button-toggle-appearance-standard'; return (await host.hasClass(className)) ? 'standard' : 'legacy'; } /** Focuses the toggle. */ async focus() { return (await this._button()).focus(); } /** Blurs the toggle. */ async blur() { return (await this._button()).blur(); } /** Whether the toggle is focused. */ async isFocused() { return (await this._button()).isFocused(); } /** Toggle the checked state of the buttons toggle. */ async toggle() { return (await this._button()).click(); } /** * Puts the button toggle in a checked state by toggling it if it's * currently unchecked, or doing nothing if it is already checked. */ async check() { if (!(await this.isChecked())) { await this.toggle(); } } /** * Puts the button toggle in an unchecked state by toggling it if it's * currently checked, or doing nothing if it's already unchecked. */ async uncheck() { if (await this.isChecked()) { await this.toggle(); } } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnV0dG9uLXRvZ2dsZS1oYXJuZXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2J1dHRvbi10b2dnbGUvdGVzdGluZy9idXR0b24tdG9nZ2xlLWhhcm5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGdCQUFnQixFQUFFLGdCQUFnQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDeEUsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFJNUQsMEVBQTBFO0FBQzFFLE1BQU0sT0FBTyxzQkFBdUIsU0FBUSxnQkFBZ0I7SUFBNUQ7O1FBSVUsV0FBTSxHQUFHLElBQUksQ0FBQyxVQUFVLENBQUMsa0NBQWtDLENBQUMsQ0FBQztRQUM3RCxZQUFPLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQywyQkFBMkIsQ0FBQyxDQUFDO0lBd0dqRSxDQUFDO0lBNUdDLG1FQUFtRTthQUM1RCxpQkFBWSxHQUFHLG9CQUFvQixBQUF2QixDQUF3QjtJQUszQzs7Ozs7T0FLRztJQUNILE1BQU0sQ0FBQyxJQUFJL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