{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/legacy-menu/testing/menu-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 {HarnessPredicate} from '@angular/cdk/testing';\nimport {\n MenuHarnessFilters,\n MenuItemHarnessFilters,\n _MatMenuHarnessBase,\n _MatMenuItemHarnessBase,\n} from '@angular/material/menu/testing';\n\n/**\n * Harness for interacting with a standard mat-menu in tests.\n * @deprecated Use `MatMenuHarness` from `@angular/material/menu/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyMenuHarness extends _MatMenuHarnessBase<\n typeof MatLegacyMenuItemHarness,\n MatLegacyMenuItemHarness,\n MenuItemHarnessFilters\n> {\n /** The selector for the host element of a `MatMenu` instance. */\n static hostSelector = '.mat-menu-trigger';\n protected _itemClass = MatLegacyMenuItemHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatMenuHarness` that meets certain\n * criteria.\n * @param options Options for filtering which menu instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: MenuHarnessFilters = {}): HarnessPredicate {\n return new HarnessPredicate(MatLegacyMenuHarness, options).addOption(\n 'triggerText',\n options.triggerText,\n (harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text),\n );\n }\n}\n\n/**\n * Harness for interacting with a standard mat-menu-item in tests.\n * @deprecated Use `MatMenuItemHarness` from `@angular/material/menu/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyMenuItemHarness extends _MatMenuItemHarnessBase<\n typeof MatLegacyMenuHarness,\n MatLegacyMenuHarness\n> {\n /** The selector for the host element of a `MatMenuItem` instance. */\n static hostSelector = '.mat-menu-item';\n protected _menuClass = MatLegacyMenuHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatMenuItemHarness` that meets\n * certain criteria.\n * @param options Options for filtering which menu item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: MenuItemHarnessFilters = {}): HarnessPredicate {\n return new HarnessPredicate(MatLegacyMenuItemHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption(\n 'hasSubmenu',\n options.hasSubmenu,\n async (harness, hasSubmenu) => (await harness.hasSubmenu()) === hasSubmenu,\n );\n }\n}\n"],"names":[],"mappings":";;;AAgBA;;;;AAIG;AACG,MAAO,oBAAqB,SAAQ,mBAIzC,CAAA;AAJD,IAAA,WAAA,GAAA;;QAOY,IAAU,CAAA,UAAA,GAAG,wBAAwB,CAAC;KAejD;;aAhBQ,IAAY,CAAA,YAAA,GAAG,mBAAH,CAAuB,EAAA;AAG1C;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAA8B,EAAE,EAAA;AAC1C,QAAA,OAAO,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,SAAS,CAClE,aAAa,EACb,OAAO,CAAC,WAAW,EACnB,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,CAClF,CAAC;KACH;;AAGH;;;;AAIG;AACG,MAAO,wBAAyB,SAAQ,uBAG7C,CAAA;AAHD,IAAA,WAAA,GAAA;;QAMY,IAAU,CAAA,UAAA,GAAG,oBAAoB,CAAC;KAmB7C;;aApBQ,IAAY,CAAA,YAAA,GAAG,gBAAH,CAAoB,EAAA;AAGvC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAkC,EAAE,EAAA;AAC9C,QAAA,OAAO,IAAI,gBAAgB,CAAC,wBAAwB,EAAE,OAAO,CAAC;aAC3D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAC7C,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CACxD;aACA,SAAS,CACR,YAAY,EACZ,OAAO,CAAC,UAAU,EAClB,OAAO,OAAO,EAAE,UAAU,KAAK,CAAC,MAAM,OAAO,CAAC,UAAU,EAAE,MAAM,UAAU,CAC3E,CAAC;KACL;;;;;"}