API reference for Angular Material toolbar-testing

import {MatToolbarHarness} from '@angular/material/toolbar/testing';

Harness for interacting with a standard mat-toolbar in tests.

Properties
Name Description

static hostSelector: '.mat-toolbar'

Methods
async
getAllChildLoaders
Parameters

selector

S

Returns
Promise<HarnessLoader[]>

async
getAllHarnesses
Parameters

query

HarnessQuery<T>

Returns
Promise<T[]>

async
getChildLoader
Parameters

selector

S

Returns
Promise<HarnessLoader>

async
getHarness
Parameters

query

HarnessQuery<T>

Returns
Promise<T>

async
getHarnessOrNull
Parameters

query

HarnessQuery<T>

Returns
Promise<T | null>

async
getRowsAsText

Gets the text of each row in the toolbar.

Returns
Promise<string[]>

async
hasHarness
Parameters

query

HarnessQuery<T>

Returns
Promise<boolean>

async
hasMultipleRows

Whether the toolbar has multiple rows.

Returns
Promise<boolean>

async
host

Gets a Promise for the TestElement representing the host element of the component.

Returns
Promise<TestElement>

static
with

Gets a HarnessPredicate that can be used to search for a MatToolbarHarness that meets certain criteria.

Parameters

options

ToolbarHarnessFilters = {}

Options for filtering which card instances are considered a match.

Returns
HarnessPredicate<MatToolbarHarness>

a HarnessPredicate configured with the given options.

A set of criteria that can be used to filter a list of MatToolbarHarness instances.

Properties
Name Description

text: string | RegExp

Only find instances whose text matches the given value.