API reference for Angular Material sidenav-testing

import {MatDrawerHarness} from '@angular/material/sidenav/testing';

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

Methods
async
getMode

Gets the mode that the drawer is in.

Returns
Promise<'over' | 'push' | 'side'>

async
getPosition

Gets the position of the drawer inside its container.

Returns
Promise<'start' | 'end'>

async
host

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

Returns
Promise<TestElement>

async
isOpen

Whether the drawer is open.

Returns
Promise<boolean>

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

Methods
async
getMode

Gets the mode that the drawer is in.

Returns
Promise<'over' | 'push' | 'side'>

async
getPosition

Gets the position of the drawer inside its container.

Returns
Promise<'start' | 'end'>

async
host

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

Returns
Promise<TestElement>

async
isFixedInViewport

Whether the sidenav is fixed in the viewport.

Returns
Promise<boolean>

async
isOpen

Whether the drawer is open.

Returns
Promise<boolean>

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

Properties
Name Description

position: 'start' | 'end'

Only find instances whose side is the given value.