API reference for Angular Material tooltip-testing

import {MatTooltipHarness} from '@angular/material/tooltip/testing';

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

Properties
Name Description

static hostSelector: '.mat-tooltip-trigger'

Methods
async
getTooltipText

Gets a promise for the tooltip panel's text.

Returns
Promise<string>

async
hide

Hides the tooltip.

Returns
Promise<void>

Promise that resolves when the action completes.

async
host

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

Returns
Promise<TestElement>

async
isOpen

Gets whether the tooltip is open.

Returns
Promise<boolean>

async
show

Shows the tooltip.

Returns
Promise<void>

Promise that resolves when the action completes.

static
with

Gets a HarnessPredicate that can be used to search for a tooltip trigger with specific attributes.

Parameters

options

TooltipHarnessFilters = {}

Options for narrowing the search.

Returns
HarnessPredicate<MatTooltipHarness>

a HarnessPredicate configured with the given options.

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