diff --git a/src/material/datepicker/testing/date-range-input-harness.ts b/src/material/datepicker/testing/date-range-input-harness.ts index 037f6f9a5987..4504717007fe 100644 --- a/src/material/datepicker/testing/date-range-input-harness.ts +++ b/src/material/datepicker/testing/date-range-input-harness.ts @@ -48,7 +48,7 @@ export class MatEndDateHarness extends MatDatepickerInputHarnessBase { export class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase { static hostSelector = '.mat-date-range-input'; - private readonly floatingLabelSelector = '.mdc-floating-label'; + private readonly _floatingLabelSelector = '.mdc-floating-label'; /** * Gets a `HarnessPredicate` that can be used to search for a `MatDateRangeInputHarness` @@ -94,22 +94,22 @@ export class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase { /** Gets the floating label text for the range input, if it exists. */ async getLabel(): Promise { // Copied from MatFormFieldControlHarnessBase since this class cannot extend two classes - const documentRootLocator = await this.documentRootLocatorFactory(); + const documentRootLocator = this.documentRootLocatorFactory(); const labelId = await (await this.host()).getAttribute('aria-labelledby'); const hostId = await (await this.host()).getAttribute('id'); if (labelId) { // First option, try to fetch the label using the `aria-labelledby` // attribute. - const labelEl = await await documentRootLocator.locatorForOptional( - `${this.floatingLabelSelector}[id="${labelId}"]`, + const labelEl = await documentRootLocator.locatorForOptional( + `${this._floatingLabelSelector}[id="${labelId}"]`, )(); return labelEl ? labelEl.text() : null; } else if (hostId) { // Fallback option, try to match the id of the input with the `for` // attribute of the label. - const labelEl = await await documentRootLocator.locatorForOptional( - `${this.floatingLabelSelector}[for="${hostId}"]`, + const labelEl = await documentRootLocator.locatorForOptional( + `${this._floatingLabelSelector}[for="${hostId}"]`, )(); return labelEl ? labelEl.text() : null; } diff --git a/src/material/form-field/testing/control/form-field-control-harness.ts b/src/material/form-field/testing/control/form-field-control-harness.ts index 05edc1b89fe8..39f2874e090b 100644 --- a/src/material/form-field/testing/control/form-field-control-harness.ts +++ b/src/material/form-field/testing/control/form-field-control-harness.ts @@ -18,26 +18,26 @@ export abstract class MatFormFieldControlHarness extends ComponentHarness {} * Shared behavior for `MatFormFieldControlHarness` implementations */ export abstract class MatFormFieldControlHarnessBase extends MatFormFieldControlHarness { - private readonly floatingLabelSelector = '.mdc-floating-label'; + private readonly _floatingLabelSelector = '.mdc-floating-label'; /** Gets the text content of the floating label, if it exists. */ - public async getLabel(): Promise { - const documentRootLocator = await this.documentRootLocatorFactory(); + async getLabel(): Promise { + const documentRootLocator = this.documentRootLocatorFactory(); const labelId = await (await this.host()).getAttribute('aria-labelledby'); const hostId = await (await this.host()).getAttribute('id'); if (labelId) { // First option, try to fetch the label using the `aria-labelledby` // attribute. - const labelEl = await await documentRootLocator.locatorForOptional( - `${this.floatingLabelSelector}[id="${labelId}"]`, + const labelEl = await documentRootLocator.locatorForOptional( + `${this._floatingLabelSelector}[id="${labelId}"]`, )(); return labelEl ? labelEl.text() : null; } else if (hostId) { // Fallback option, try to match the id of the input with the `for` // attribute of the label. - const labelEl = await await documentRootLocator.locatorForOptional( - `${this.floatingLabelSelector}[for="${hostId}"]`, + const labelEl = await documentRootLocator.locatorForOptional( + `${this._floatingLabelSelector}[for="${hostId}"]`, )(); return labelEl ? labelEl.text() : null; } diff --git a/src/material/select/testing/select-harness-filters.ts b/src/material/select/testing/select-harness-filters.ts index 34e219a456d0..cacbeb900d27 100644 --- a/src/material/select/testing/select-harness-filters.ts +++ b/src/material/select/testing/select-harness-filters.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://angular.dev/license */ -import {BaseHarnessFilters} from '@angular/cdk/testing'; import {MatFormFieldControlHarnessFilters} from '@angular/material/form-field/testing/control'; /** A set of criteria that can be used to filter a list of `MatSelectHarness` instances. */