{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/toolbar/testing/toolbar-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {ToolbarHarnessFilters} from './toolbar-harness-filters';\n\n/** Selectors for different sections of the mat-toolbar that contain user content. */\nexport const enum MatToolbarSection {\n ROW = '.mat-toolbar-row',\n}\n\n/** Harness for interacting with a standard mat-toolbar in tests. */\nexport class MatToolbarHarness extends ContentContainerComponentHarness {\n static hostSelector = '.mat-toolbar';\n\n private _getRows = this.locatorForAll(MatToolbarSection.ROW);\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatToolbarHarness` that meets\n * certain criteria.\n * @param options Options for filtering which card instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ToolbarHarnessFilters = {}): HarnessPredicate {\n return new HarnessPredicate(MatToolbarHarness, options).addOption(\n 'text',\n options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness._getText(), text),\n );\n }\n\n /** Whether the toolbar has multiple rows. */\n async hasMultipleRows(): Promise {\n return (await this.host()).hasClass('mat-toolbar-multiple-rows');\n }\n\n /** Gets all of the toolbar's content as text. */\n private async _getText(): Promise {\n return (await this.host()).text();\n }\n\n /** Gets the text of each row in the toolbar. */\n async getRowsAsText(): Promise {\n const rows = await this._getRows();\n return parallel(() => (rows.length ? rows.map(r => r.text()) : [this._getText()]));\n }\n}\n"],"names":[],"mappings":";;AAgBA;AACM,MAAO,iBAAkB,SAAQ,gCAAmD,CAAA;AAA1F,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,aAAa,gDAAuB,CAAC;KA+B9D;aAjCQ,IAAY,CAAA,YAAA,GAAG,cAAH,CAAkB,EAAA;AAIrC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAiC,EAAE,EAAA;AAC7C,QAAA,OAAO,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,SAAS,CAC/D,MAAM,EACN,OAAO,CAAC,IAAI,EACZ,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAC5E,CAAC;KACH;;AAGD,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CAAC;KAClE;;AAGO,IAAA,MAAM,QAAQ,GAAA;QACpB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;KACnC;;AAGD,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;AACnC,QAAA,OAAO,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;KACpF;;;;;"}