/** * @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 { coerceNumberProperty } from '@angular/cdk/coercion'; import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing'; /** * Harness for interacting with a standard mat-progress-spinner in tests. * @deprecated Use `MatProgressSpinnerHarness` from `@angular/material/progress-spinner/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. * @breaking-change 17.0.0 */ export class MatLegacyProgressSpinnerHarness extends ComponentHarness { /** The selector for the host element of a Progress Spinner instance. */ static { this.hostSelector = '.mat-progress-spinner'; } /** * Gets a `HarnessPredicate` that can be used to search for a `MatProgressSpinnerHarness` that * meets certain criteria. * @param options Options for filtering which progress spinner instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(MatLegacyProgressSpinnerHarness, options); } /** Gets the progress spinner's value. */ async getValue() { const host = await this.host(); const ariaValue = await host.getAttribute('aria-valuenow'); return ariaValue ? coerceNumberProperty(ariaValue) : null; } /** Gets the progress spinner's mode. */ async getMode() { const modeAttr = (await this.host()).getAttribute('mode'); return (await modeAttr); } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3Jlc3Mtc3Bpbm5lci1oYXJuZXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2xlZ2FjeS1wcm9ncmVzcy1zcGlubmVyL3Rlc3RpbmcvcHJvZ3Jlc3Mtc3Bpbm5lci1oYXJuZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxvQkFBb0IsRUFBQyxNQUFNLHVCQUF1QixDQUFDO0FBQzNELE9BQU8sRUFBQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFBQyxNQUFNLHNCQUFz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