source: trip-planner-front/node_modules/@angular/material/esm2015/progress-spinner/testing/progress-spinner-harness.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 5.2 KB
Line 
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 */
8import { __awaiter } from "tslib";
9import { coerceNumberProperty } from '@angular/cdk/coercion';
10import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
11/** Harness for interacting with a standard mat-progress-spinner in tests. */
12export class MatProgressSpinnerHarness extends ComponentHarness {
13 /**
14 * Gets a `HarnessPredicate` that can be used to search for a `MatProgressSpinnerHarness` that
15 * meets certain criteria.
16 * @param options Options for filtering which progress spinner instances are considered a match.
17 * @return a `HarnessPredicate` configured with the given options.
18 */
19 static with(options = {}) {
20 return new HarnessPredicate(MatProgressSpinnerHarness, options);
21 }
22 /** Gets the progress spinner's value. */
23 getValue() {
24 return __awaiter(this, void 0, void 0, function* () {
25 const host = yield this.host();
26 const ariaValue = yield host.getAttribute('aria-valuenow');
27 return ariaValue ? coerceNumberProperty(ariaValue) : null;
28 });
29 }
30 /** Gets the progress spinner's mode. */
31 getMode() {
32 return __awaiter(this, void 0, void 0, function* () {
33 const modeAttr = (yield this.host()).getAttribute('mode');
34 return yield modeAttr;
35 });
36 }
37}
38/** The selector for the host element of a `MatProgressSpinner` instance. */
39MatProgressSpinnerHarness.hostSelector = '.mat-progress-spinner';
40//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3Jlc3Mtc3Bpbm5lci1oYXJuZXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL3Byb2dyZXNzLXNwaW5uZXIvdGVzdGluZy9wcm9ncmVzcy1zcGlubm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