You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.3 KiB
67 lines
2.3 KiB
import { __awaiter } from 'tslib';
|
|
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
/** Harness for interacting with a standard mat-progress-spinner in tests. */
|
|
class MatProgressSpinnerHarness extends ComponentHarness {
|
|
/**
|
|
* 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(MatProgressSpinnerHarness, options);
|
|
}
|
|
/** Gets the progress spinner's value. */
|
|
getValue() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const host = yield this.host();
|
|
const ariaValue = yield host.getAttribute('aria-valuenow');
|
|
return ariaValue ? coerceNumberProperty(ariaValue) : null;
|
|
});
|
|
}
|
|
/** Gets the progress spinner's mode. */
|
|
getMode() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const modeAttr = (yield this.host()).getAttribute('mode');
|
|
return yield modeAttr;
|
|
});
|
|
}
|
|
}
|
|
/** The selector for the host element of a `MatProgressSpinner` instance. */
|
|
MatProgressSpinnerHarness.hostSelector = '.mat-progress-spinner';
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
|
|
export { MatProgressSpinnerHarness };
|
|
//# sourceMappingURL=testing.js.map
|