/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ComponentHarness, HarnessPredicate, } from '@angular/cdk/testing'; import { MatSelectHarness } from '@angular/material/select/testing'; import { coerceNumberProperty } from '@angular/cdk/coercion'; export class _MatPaginatorHarnessBase extends ComponentHarness { /** Goes to the next page in the paginator. */ async goToNextPage() { return (await this._nextButton()).click(); } /** Returns whether or not the next page button is disabled. */ async isNextPageDisabled() { const disabledValue = await (await this._nextButton()).getAttribute('disabled'); return disabledValue == 'true'; } /* Returns whether or not the previous page button is disabled. */ async isPreviousPageDisabled() { const disabledValue = await (await this._previousButton()).getAttribute('disabled'); return disabledValue == 'true'; } /** Goes to the previous page in the paginator. */ async goToPreviousPage() { return (await this._previousButton()).click(); } /** Goes to the first page in the paginator. */ async goToFirstPage() { const button = await this._firstPageButton(); // The first page button isn't enabled by default so we need to check for it. if (!button) { throw Error('Could not find first page button inside paginator. ' + 'Make sure that `showFirstLastButtons` is enabled.'); } return button.click(); } /** Goes to the last page in the paginator. */ async goToLastPage() { const button = await this._lastPageButton(); // The last page button isn't enabled by default so we need to check for it. if (!button) { throw Error('Could not find last page button inside paginator. ' + 'Make sure that `showFirstLastButtons` is enabled.'); } return button.click(); } /** * Sets the page size of the paginator. * @param size Page size that should be select. */ async setPageSize(size) { const select = await this._select(); // The select is only available if the `pageSizeOptions` are // set to an array with more than one item. if (!select) { throw Error('Cannot find page size selector in paginator. ' + 'Make sure that the `pageSizeOptions` have been configured.'); } return select.clickOptions({ text: `${size}` }); } /** Gets the page size of the paginator. */ async getPageSize() { const select = await this._select(); const value = select ? select.getValueText() : (await this._pageSizeFallback()).text(); return coerceNumberProperty(await value); } /** Gets the text of the range label of the paginator. */ async getRangeLabel() { return (await this._rangeLabel()).text(); } } /** Harness for interacting with an MDC-based mat-paginator in tests. */ export class MatPaginatorHarness extends _MatPaginatorHarnessBase { constructor() { super(...arguments); this._nextButton = this.locatorFor('.mat-mdc-paginator-navigation-next'); this._previousButton = this.locatorFor('.mat-mdc-paginator-navigation-previous'); this._firstPageButton = this.locatorForOptional('.mat-mdc-paginator-navigation-first'); this._lastPageButton = this.locatorForOptional('.mat-mdc-paginator-navigation-last'); this._select = this.locatorForOptional(MatSelectHarness.with({ ancestor: '.mat-mdc-paginator-page-size', })); this._pageSizeFallback = this.locatorFor('.mat-mdc-paginator-page-size-value'); this._rangeLabel = this.locatorFor('.mat-mdc-paginator-range-label'); } /** Selector used to find paginator instances. */ static { this.hostSelector = '.mat-mdc-paginator'; } /** * Gets a `HarnessPredicate` that can be used to search for a paginator with specific attributes. * @param options Options for filtering which paginator instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(this, options); } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdG9yLWhhcm5lc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvcGFnaW5hdG9yL3Rlc3RpbmcvcGFnaW5hdG9yLWhhcm5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUVMLGdCQUFnQixFQUVoQixnQkFBZ0IsR0FFakIsTUFBTSxzQkFBc0IsQ0FBQztBQUM5QixPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSxrQ0FBa0MsQ0FBQztBQUNsRSxPQUFPLEVBQUMsb0JBQW9CLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUczRCxNQUFNLE9BQWdCLHdCQUF5QixTQUFRLGdCQUFnQjtJQWVyRSw4Q0FBOEM7SUFDOUMsS0FBSyxDQUFDLFlBQVk7UUFDaEIsT0FBTyxDQUFDLE1BQU0sSUFBSSxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUMsS0FBSyxFQUFFLEN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