/** * @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 { MatExpansionPanelHarness } from './expansion-harness'; /** Harness for interacting with a standard mat-accordion in tests. */ export class MatAccordionHarness extends ComponentHarness { static { this.hostSelector = '.mat-accordion'; } /** * Gets a `HarnessPredicate` that can be used to search for an accordion * with specific attributes. * @param options Options for narrowing the search. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(MatAccordionHarness, options); } /** Gets all expansion panels which are part of the accordion. */ async getExpansionPanels(filter = {}) { return this.locatorForAll(MatExpansionPanelHarness.with(filter))(); } /** Whether the accordion allows multiple expanded panels simultaneously. */ async isMulti() { return (await this.host()).hasClass('mat-accordion-multi'); } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3JkaW9uLWhhcm5lc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvZXhwYW5zaW9uL3Rlc3RpbmcvYWNjb3JkaW9uLWhhcm5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGdCQUFnQixFQUFFLGdCQUFnQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDeEUsT0FBTyxFQUFDLHdCQUF3QixFQUFDLE1BQU0scUJBQXFCLENBQUM7QUFHN0Qsc0VBQXNFO0FBQ3RFLE1BQU0sT0FBTyxtQkFBb0IsU0FBUSxnQkFBZ0I7YUFDaEQsaUJBQVksR0FBRyxnQkFBZ0IsQ0FBQztJQUV2Qzs7Ozs7T0FLRztJQUNILE1BQU0sQ0FBQyxJQUFJLENBQUMsVUFBbUMsRUFBRTtRQUMvQyxPQUFPLElBQUksZ0JBQWdCLENBQUM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