API reference for Angular Material dialog-testing

import {MatDialogHarness} from '@angular/material/dialog/testing';

Harness for interacting with a standard MatDialog in tests.

Methods
async
close

Closes the dialog by pressing escape.

Note: this method does nothing if disableClose has been set to true for the dialog.

Returns
Promise<void>

Promise that resolves when the action completes.

async
getAriaDescribedby

Gets the value of the dialog's "aria-describedby" attribute.

Returns
Promise<string | null>

async
getAriaLabel

Gets the value of the dialog's "aria-label" attribute.

Returns
Promise<string | null>

async
getAriaLabelledby

Gets the value of the dialog's "aria-labelledby" attribute.

Returns
Promise<string | null>

async
getId

Gets the id of the dialog.

Returns
Promise<string | null>

async
getRole

Gets the role of the dialog.

Returns
Promise<DialogRole | null>

async
host

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

Returns
Promise<TestElement>

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