{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/legacy-snack-bar/testing/snack-bar-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 */\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {_MatSnackBarHarnessBase, SnackBarHarnessFilters} from '@angular/material/snack-bar/testing';\n\n/**\n * Harness for interacting with a standard mat-snack-bar in tests.\n * @deprecated Use `MatSnackBarHarness` from `@angular/material/snack-bar/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacySnackBarHarness extends _MatSnackBarHarnessBase {\n // Developers can provide a custom component or template for the snackbar. The canonical snack-bar\n // parent is the \"MatSnackBarContainer\". We use `:not([mat-exit])` to exclude snack bars that\n // are in the process of being dismissed, because the element only gets removed after the\n // animation is finished and since it runs outside of Angular, we don't have a way of being\n // notified when it's done.\n /** The selector for the host element of a `MatSnackBar` instance. */\n static hostSelector = '.mat-snack-bar-container';\n protected override _messageSelector = '.mat-simple-snackbar > span';\n protected override _actionButtonSelector = '.mat-simple-snackbar-action > button';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a snack bar with specific attributes.\n * @param options Options for filtering which snack bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: SnackBarHarnessFilters = {}): HarnessPredicate {\n return new HarnessPredicate(MatLegacySnackBarHarness, options);\n }\n\n protected override async _assertContentAnnotated() {\n if (!(await this._isSimpleSnackBar())) {\n throw Error('Method cannot be used for snack-bar with custom content.');\n }\n }\n\n /** Whether the snack-bar is using the default content template. */\n private async _isSimpleSnackBar(): Promise {\n return (await this.locatorForOptional('.mat-simple-snackbar')()) !== null;\n }\n}\n"],"names":[],"mappings":";;;AAUA;;;;AAIG;AACG,MAAO,wBAAyB,SAAQ,uBAAuB,CAAA;AAArE,IAAA,WAAA,GAAA;;QAQqB,IAAgB,CAAA,gBAAA,GAAG,6BAA6B,CAAC;QACjD,IAAqB,CAAA,qBAAA,GAAG,sCAAsC,CAAC;KAqBnF;;;;;;;aAvBQ,IAAY,CAAA,YAAA,GAAG,0BAAH,CAA8B,EAAA;AAIjD;;;;AAIG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAkC,EAAE,EAAA;AAC9C,QAAA,OAAO,IAAI,gBAAgB,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;KAChE;AAEkB,IAAA,MAAM,uBAAuB,GAAA;QAC9C,IAAI,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE;AACrC,YAAA,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;AACzE,SAAA;KACF;;AAGO,IAAA,MAAM,iBAAiB,GAAA;AAC7B,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3E;;;;;"}