{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/legacy-checkbox/testing/checkbox-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 {_MatCheckboxHarnessBase, CheckboxHarnessFilters} from '@angular/material/checkbox/testing';\n\n/**\n * Harness for interacting with a standard mat-checkbox in tests.\n * @deprecated Use `MatCheckboxHarness` from `@angular/material/checkbox/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyCheckboxHarness extends _MatCheckboxHarnessBase {\n /** The selector for the host element of a checkbox instance. */\n static hostSelector = '.mat-checkbox';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a checkbox harness that meets\n * certain criteria.\n * @param options Options for filtering which checkbox instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CheckboxHarnessFilters = {}): HarnessPredicate {\n return (\n new HarnessPredicate(MatLegacyCheckboxHarness, options)\n .addOption('label', options.label, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getLabelText(), label),\n )\n // We want to provide a filter option for \"name\" because the name of the checkbox is\n // only set on the underlying input. This means that it's not possible for developers\n // to retrieve the harness of a specific checkbox with name through a CSS selector.\n .addOption(\n 'name',\n options.name,\n async (harness, name) => (await harness.getName()) === name,\n )\n .addOption(\n 'checked',\n options.checked,\n async (harness, checked) => (await harness.isChecked()) == checked,\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n })\n );\n }\n\n protected _input = this.locatorFor('input');\n protected _label = this.locatorFor('.mat-checkbox-label');\n private _inputContainer = this.locatorFor('.mat-checkbox-inner-container');\n\n async toggle(): Promise {\n return (await this._inputContainer()).click();\n }\n}\n"],"names":[],"mappings":";;;AAWA;;;;AAIG;AACG,MAAO,wBAAyB,SAA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