import { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing'; /** * Harness for interacting with a standard mat-card in tests. * @deprecated Use `MatCardHarness` from `@angular/material/card/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. * @breaking-change 17.0.0 */ class MatLegacyCardHarness extends ContentContainerComponentHarness { constructor() { super(...arguments); this._title = this.locatorForOptional('.mat-card-title'); this._subtitle = this.locatorForOptional('.mat-card-subtitle'); } /** The selector for the host element of a `MatCard` instance. */ static { this.hostSelector = '.mat-card'; } /** * Gets a `HarnessPredicate` that can be used to search for a `MatCardHarness` that meets * certain criteria. * @param options Options for filtering which card instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(MatLegacyCardHarness, options) .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text)) .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitleText(), title)) .addOption('subtitle', options.subtitle, (harness, subtitle) => HarnessPredicate.stringMatches(harness.getSubtitleText(), subtitle)); } /** Gets all of the card's content as text. */ async getText() { return (await this.host()).text(); } /** Gets the cards's title text. */ async getTitleText() { return (await this._title())?.text() ?? ''; } /** Gets the cards's subtitle text. */ async getSubtitleText() { return (await this._subtitle())?.text() ?? ''; } } export { MatLegacyCardHarness }; //# sourceMappingURL=testing.mjs.map