1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { __awaiter } from "tslib";
|
---|
9 | import { ComponentHarness, HarnessPredicate, } from '@angular/cdk/testing';
|
---|
10 | import { MatSelectHarness } from '@angular/material/select/testing';
|
---|
11 | import { coerceNumberProperty } from '@angular/cdk/coercion';
|
---|
12 | export class _MatPaginatorHarnessBase extends ComponentHarness {
|
---|
13 | /** Goes to the next page in the paginator. */
|
---|
14 | goToNextPage() {
|
---|
15 | return __awaiter(this, void 0, void 0, function* () {
|
---|
16 | return (yield this._nextButton()).click();
|
---|
17 | });
|
---|
18 | }
|
---|
19 | /** Goes to the previous page in the paginator. */
|
---|
20 | goToPreviousPage() {
|
---|
21 | return __awaiter(this, void 0, void 0, function* () {
|
---|
22 | return (yield this._previousButton()).click();
|
---|
23 | });
|
---|
24 | }
|
---|
25 | /** Goes to the first page in the paginator. */
|
---|
26 | goToFirstPage() {
|
---|
27 | return __awaiter(this, void 0, void 0, function* () {
|
---|
28 | const button = yield this._firstPageButton();
|
---|
29 | // The first page button isn't enabled by default so we need to check for it.
|
---|
30 | if (!button) {
|
---|
31 | throw Error('Could not find first page button inside paginator. ' +
|
---|
32 | 'Make sure that `showFirstLastButtons` is enabled.');
|
---|
33 | }
|
---|
34 | return button.click();
|
---|
35 | });
|
---|
36 | }
|
---|
37 | /** Goes to the last page in the paginator. */
|
---|
38 | goToLastPage() {
|
---|
39 | return __awaiter(this, void 0, void 0, function* () {
|
---|
40 | const button = yield this._lastPageButton();
|
---|
41 | // The last page button isn't enabled by default so we need to check for it.
|
---|
42 | if (!button) {
|
---|
43 | throw Error('Could not find last page button inside paginator. ' +
|
---|
44 | 'Make sure that `showFirstLastButtons` is enabled.');
|
---|
45 | }
|
---|
46 | return button.click();
|
---|
47 | });
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Sets the page size of the paginator.
|
---|
51 | * @param size Page size that should be select.
|
---|
52 | */
|
---|
53 | setPageSize(size) {
|
---|
54 | return __awaiter(this, void 0, void 0, function* () {
|
---|
55 | const select = yield this._select();
|
---|
56 | // The select is only available if the `pageSizeOptions` are
|
---|
57 | // set to an array with more than one item.
|
---|
58 | if (!select) {
|
---|
59 | throw Error('Cannot find page size selector in paginator. ' +
|
---|
60 | 'Make sure that the `pageSizeOptions` have been configured.');
|
---|
61 | }
|
---|
62 | return select.clickOptions({ text: `${size}` });
|
---|
63 | });
|
---|
64 | }
|
---|
65 | /** Gets the page size of the paginator. */
|
---|
66 | getPageSize() {
|
---|
67 | return __awaiter(this, void 0, void 0, function* () {
|
---|
68 | const select = yield this._select();
|
---|
69 | const value = select ? select.getValueText() : (yield this._pageSizeFallback()).text();
|
---|
70 | return coerceNumberProperty(yield value);
|
---|
71 | });
|
---|
72 | }
|
---|
73 | /** Gets the text of the range labe of the paginator. */
|
---|
74 | getRangeLabel() {
|
---|
75 | return __awaiter(this, void 0, void 0, function* () {
|
---|
76 | return (yield this._rangeLabel()).text();
|
---|
77 | });
|
---|
78 | }
|
---|
79 | }
|
---|
80 | /** Harness for interacting with a standard mat-paginator in tests. */
|
---|
81 | export class MatPaginatorHarness extends _MatPaginatorHarnessBase {
|
---|
82 | constructor() {
|
---|
83 | super(...arguments);
|
---|
84 | this._nextButton = this.locatorFor('.mat-paginator-navigation-next');
|
---|
85 | this._previousButton = this.locatorFor('.mat-paginator-navigation-previous');
|
---|
86 | this._firstPageButton = this.locatorForOptional('.mat-paginator-navigation-first');
|
---|
87 | this._lastPageButton = this.locatorForOptional('.mat-paginator-navigation-last');
|
---|
88 | this._select = this.locatorForOptional(MatSelectHarness.with({
|
---|
89 | ancestor: '.mat-paginator-page-size'
|
---|
90 | }));
|
---|
91 | this._pageSizeFallback = this.locatorFor('.mat-paginator-page-size-value');
|
---|
92 | this._rangeLabel = this.locatorFor('.mat-paginator-range-label');
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Gets a `HarnessPredicate` that can be used to search for a `MatPaginatorHarness` that meets
|
---|
96 | * certain criteria.
|
---|
97 | * @param options Options for filtering which paginator instances are considered a match.
|
---|
98 | * @return a `HarnessPredicate` configured with the given options.
|
---|
99 | */
|
---|
100 | static with(options = {}) {
|
---|
101 | return new HarnessPredicate(MatPaginatorHarness, options);
|
---|
102 | }
|
---|
103 | }
|
---|
104 | /** Selector used to find paginator instances. */
|
---|
105 | MatPaginatorHarness.hostSelector = '.mat-paginator';
|
---|
106 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdG9yLWhhcm5lc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvcGFnaW5hdG9yL3Rlc3RpbmcvcGFnaW5hdG9yLWhhcm5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOztBQUVILE9BQU8sRUFFTCxnQkFBZ0IsRUFDaEIsZ0JBQWdCLEdBRWpCLE1BQU0sc0JBQXNCLENBQUM7QUFDOUIsT0FBTyxFQUFDLGdCQUFnQixFQUFDLE1BQU0sa0NBQWtDLENBQUM7QUFDbEUsT0FBTyxFQUFDLG9CQUFvQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFHM0QsTUFBTSxPQUFnQix3QkFBeUIsU0FBUSxnQkFBZ0I7SUFZckUsOENBQThDO0lBQ3hDLFlBQVk7O1lBQ2hCLE9BQU8sQ0FBQyxNQUFNLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO1FBQzVDLENBQUM7S0FBQTtJQUVELGtEQUFrRDtJQUM1QyxnQkFBZ0I7O1lBQ3BCLE9BQU8sQ0FBQyxNQUFNLElBQUksQ0FBQyxlQUFlLEVBQ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