MCPcopy
hub / github.com/angular/components / with

Method with

src/aria/tabs/testing/tabs-harness.ts:27–42  ·  view source on GitHub ↗

* Gets a `HarnessPredicate` that can be used to search for a `TabHarness` * that meets certain criteria. * @param options Options for filtering which tab instances are considered a match. * @return a `HarnessPredicate` configured with the given options.

(options: TabHarnessFilters = {})

Source from the content-addressed store, hash-verified

25 * @return a `HarnessPredicate` configured with the given options.
26 */
27 static with(options: TabHarnessFilters = {}): HarnessPredicate<TabHarness> {
28 return new HarnessPredicate(TabHarness, options)
29 .addOption('title', options.title, (harness, title) =>
30 HarnessPredicate.stringMatches(harness.getTitle(), title),
31 )
32 .addOption(
33 'selected',
34 options.selected,
35 async (harness, selected) => (await harness.isSelected()) === selected,
36 )
37 .addOption(
38 'disabled',
39 options.disabled,
40 async (harness, disabled) => (await harness.isDisabled()) === disabled,
41 );
42 }
43
44 /** Gets the tab's title text. */
45 async getTitle(): Promise<string> {

Callers 1

getTabsMethod · 0.45

Calls 5

addOptionMethod · 0.80
stringMatchesMethod · 0.80
isSelectedMethod · 0.65
getTitleMethod · 0.45
isDisabledMethod · 0.45

Tested by

no test coverage detected