* Gets a `HarnessPredicate` that can be used to search for a card with specific attributes. * @param options Options for filtering which card instances are considered a match. * @return a `HarnessPredicate` configured with the given options.
(
this: ComponentHarnessConstructor<T>,
options: CardHarnessFilters = {},
)
| 32 | * @return a `HarnessPredicate` configured with the given options. |
| 33 | */ |
| 34 | static with<T extends MatCardHarness>( |
| 35 | this: ComponentHarnessConstructor<T>, |
| 36 | options: CardHarnessFilters = {}, |
| 37 | ): HarnessPredicate<T> { |
| 38 | return new HarnessPredicate(this, options) |
| 39 | .addOption('text', options.text, (harness, text) => |
| 40 | HarnessPredicate.stringMatches(harness.getText(), text), |
| 41 | ) |
| 42 | .addOption('title', options.title, (harness, title) => |
| 43 | HarnessPredicate.stringMatches(harness.getTitleText(), title), |
| 44 | ) |
| 45 | .addOption('subtitle', options.subtitle, (harness, subtitle) => |
| 46 | HarnessPredicate.stringMatches(harness.getSubtitleText(), subtitle), |
| 47 | ); |
| 48 | } |
| 49 | |
| 50 | private _title = this.locatorForOptional('.mat-mdc-card-title'); |
| 51 | private _subtitle = this.locatorForOptional('.mat-mdc-card-subtitle'); |
no test coverage detected