API reference for Angular Material paginator-testing

import {MatPaginatorHarness} from '@angular/material/paginator/testing';

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

Properties
Name Description

static hostSelector: '.mat-paginator'

Selector used to find paginator instances.

Methods
async
getPageSize

Gets the page size of the paginator.

Returns
Promise<number>

async
getRangeLabel

Gets the text of the range labe of the paginator.

Returns
Promise<string>

async
goToFirstPage

Goes to the first page in the paginator.

Returns
Promise<void>

Promise that resolves when the action completes.

async
goToLastPage

Goes to the last page in the paginator.

Returns
Promise<void>

Promise that resolves when the action completes.

async
goToNextPage

Goes to the next page in the paginator.

Returns
Promise<void>

Promise that resolves when the action completes.

async
goToPreviousPage

Goes to the previous page in the paginator.

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
setPageSize

Sets the page size of the paginator.

Parameters

size

number

Returns
Promise<void>

Promise that resolves when the action completes.

static
with

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

Parameters

options

PaginatorHarnessFilters = {}

Returns
HarnessPredicate<MatPaginatorHarness>

a HarnessPredicate configured with the given options.

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