/** * @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 { ContentContainerComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing'; /** Harness for interacting with a standard MatBottomSheet in tests. */ export class MatBottomSheetHarness extends ContentContainerComponentHarness { // Developers can provide a custom component or template for the // bottom sheet. The canonical parent is the ".mat-bottom-sheet-container". static { this.hostSelector = '.mat-bottom-sheet-container'; } /** * Gets a `HarnessPredicate` that can be used to search for a bottom sheet with * specific attributes. * @param options Options for narrowing the search. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(MatBottomSheetHarness, options); } /** Gets the value of the bottom sheet's "aria-label" attribute. */ async getAriaLabel() { return (await this.host()).getAttribute('aria-label'); } /** * Dismisses the bottom sheet by pressing escape. Note that this method cannot * be used if "disableClose" has been set to true via the config. */ async dismiss() { await (await this.host()).sendKeys(TestKey.ESCAPE); } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm90dG9tLXNoZWV0LWhhcm5lc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvYm90dG9tLXNoZWV0L3Rlc3RpbmcvYm90dG9tLXNoZWV0LWhhcm5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGdDQUFnQyxFQUFFLGdCQUFnQixFQUFFLE9BQU8sRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBR2pHLHVFQUF1RTtBQUN2RSxNQUFNLE9BQU8scUJBQXNCLFNBQVEsZ0NBQXdDO0lBQ2pGLGdFQUFnRTtJQUNoRSwyRUFBMkU7YUFDcEUsaUJBQVksR0FBRyw2QkFBNkIsQ0FBQztJQUVwRDs7Ozs7T0FLRztJQUNILE1BQU0sQ0FBQ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