{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/legacy-radio/testing/radio-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 RadioButtonHarnessFilters,\n RadioGroupHarnessFilters,\n _MatRadioGroupHarnessBase,\n _MatRadioButtonHarnessBase,\n} from '@angular/material/radio/testing';\n\n/**\n * Harness for interacting with a standard mat-radio-group in tests\n * @deprecated Use `MatRadioGroupHarness` from `@angular/material/radio/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyRadioGroupHarness extends _MatRadioGroupHarnessBase<\n typeof MatLegacyRadioButtonHarness,\n MatLegacyRadioButtonHarness,\n RadioButtonHarnessFilters\n> {\n /** The selector for the host element of a `MatRadioGroup` instance. */\n static hostSelector = '.mat-radio-group';\n protected _buttonClass = MatLegacyRadioButtonHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatRadioGroupHarness` that meets\n * certain criteria.\n * @param options Options for filtering which radio group instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: RadioGroupHarnessFilters = {},\n ): HarnessPredicate {\n return new HarnessPredicate(MatLegacyRadioGroupHarness, options).addOption(\n 'name',\n options.name,\n this._checkRadioGroupName,\n );\n }\n}\n\n/**\n * Harness for interacting with a standard mat-radio-button in tests.\n * @deprecated Use `MatRadioButtonHarness` from `@angular/material/radio/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyRadioButtonHarness extends _MatRadioButtonHarnessBase {\n /** The selector for the host element of a `MatRadioButton` instance. */\n static hostSelector = '.mat-radio-button';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatRadioButtonHarness` that meets\n * certain criteria.\n * @param options Options for filtering which radio button instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: RadioButtonHarnessFilters = {},\n ): HarnessPredicate {\n return new HarnessPredicate(MatLegacyRadioButtonHarness, options)\n .addOption('label', options.label, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getLabelText(), label),\n )\n .addOption('name', options.name, async (harness, name) => (await harness.getName()) === name)\n .addOption(\n 'checked',\n options.checked,\n async (harness, checked) => (await harness.isChecked()) == checked,\n );\n }\n\n protected _textLabel = this.locatorFor('.mat-radio-label-content');\n protected _clickLabel = this.locatorFor('.mat-radio-label');\n}\n"],"names":[],"mappings":";;;AAgBA;;;;AAIG;AACG,MAAO,0BAA2B,SAAQ,yBAI/C,CAAA;AAJD,IAAA,WAAA,GAAA;;QAOY,IAAY,CAAA,YAAA,GAAG,2BAA2B,CAAC;KAiBtD;;aAlBQ,IAAY,CAAA,YAAA,GAAG,kBAAH,CAAsB,EAAA;AAGzC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CACT,OAAA,GAAoC,EAAE,EAAA;QAEtC,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC,SAAS,CACxE,MAAM,EACN,OAAO,CAAC,IAAI,EACZ,IAAI,CAAC,oBAAoB,CAC1B,CAAC;KACH;;AAGH;;;;AAIG;AACG,MAAO,2BAA4B,SAAQ,0BAA0B,CAAA;AAA3E,IAAA,WAAA,GAAA;;AAyBY,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACzD,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;KAC7D;;aAzBQ,IAAY,CAAA,YAAA,GAAG,mBAAH,CAAuB,EAAA;AAE1C;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CACT,OAAA,GAAqC,EAAE,EAAA;AAEvC,QAAA,OAAO,IAAI,gBAAgB,CAAC,2BAA2B,EAAE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