@@ -10,10 +10,31 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
10
10
import { configureTestSuite } from '../../test-utils/configure-suite' ;
11
11
import { wait } from '../../test-utils/ui-interactions.spec' ;
12
12
import { IgxNumberFilteringOperand } from '../../data-operations/filtering-condition' ;
13
- import { GridFunctions } from '../../test-utils/grid-functions.spec' ;
14
- import { ControlsFunction } from '../../test-utils/controls-functions.spec' ;
13
+ import { GridFunctions , PAGER_CLASS } from '../../test-utils/grid-functions.spec' ;
14
+ import { ControlsFunction , BUTTON_DISABLED_CLASS } from '../../test-utils/controls-functions.spec' ;
15
15
import { DebugElement } from '@angular/core' ;
16
16
17
+ function verifyGridPager ( fix , rowsCount , firstCellValue , pagerText , buttonsVisibility ) {
18
+ const grid = fix . componentInstance . grid ;
19
+
20
+ expect ( grid . getCellByColumn ( 0 , 'ID' ) . value ) . toMatch ( firstCellValue ) ;
21
+ expect ( grid . rowList . length ) . toEqual ( rowsCount , 'Invalid number of rows initialized' ) ;
22
+
23
+ if ( pagerText != null ) {
24
+ expect ( grid . nativeElement . querySelector ( PAGER_CLASS ) ) . toBeDefined ( ) ;
25
+ expect ( grid . nativeElement . querySelectorAll ( 'igx-select' ) . length ) . toEqual ( 1 ) ;
26
+ expect ( grid . nativeElement . querySelector ( '.igx-paginator__pager > div' ) . textContent ) . toMatch ( pagerText ) ;
27
+ }
28
+ if ( buttonsVisibility != null && buttonsVisibility . length === 4 ) {
29
+ const pagingButtons = GridFunctions . getPagingButtons ( grid . nativeElement ) ;
30
+ expect ( pagingButtons . length ) . toEqual ( 4 ) ;
31
+ expect ( pagingButtons [ 0 ] . className . includes ( BUTTON_DISABLED_CLASS ) ) . toBe ( buttonsVisibility [ 0 ] ) ;
32
+ expect ( pagingButtons [ 1 ] . className . includes ( BUTTON_DISABLED_CLASS ) ) . toBe ( buttonsVisibility [ 1 ] ) ;
33
+ expect ( pagingButtons [ 2 ] . className . includes ( BUTTON_DISABLED_CLASS ) ) . toBe ( buttonsVisibility [ 2 ] ) ;
34
+ expect ( pagingButtons [ 3 ] . className . includes ( BUTTON_DISABLED_CLASS ) ) . toBe ( buttonsVisibility [ 3 ] ) ;
35
+ }
36
+ }
37
+
17
38
describe ( 'IgxGrid - Grid Paging #grid' , ( ) => {
18
39
configureTestSuite ( ) ;
19
40
@@ -47,27 +68,27 @@ describe('IgxGrid - Grid Paging #grid', () => {
47
68
it ( 'should paginate data UI' , ( ) => {
48
69
49
70
expect ( grid . paging ) . toBeTruthy ( ) ;
50
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
71
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
51
72
52
73
// Go to next page
53
74
GridFunctions . navigateToNextPage ( grid . nativeElement ) ;
54
75
fix . detectChanges ( ) ;
55
- GridFunctions . verifyGridPager ( fix , 3 , '4' , '2\xA0of\xA04' , [ false , false , false , false ] ) ;
76
+ verifyGridPager ( fix , 3 , '4' , '2\xA0of\xA04' , [ false , false , false , false ] ) ;
56
77
57
78
// Go to last page
58
79
GridFunctions . navigateToLastPage ( grid . nativeElement ) ;
59
80
fix . detectChanges ( ) ;
60
- GridFunctions . verifyGridPager ( fix , 1 , '10' , '4\xA0of\xA04' , [ false , false , true , true ] ) ;
81
+ verifyGridPager ( fix , 1 , '10' , '4\xA0of\xA04' , [ false , false , true , true ] ) ;
61
82
62
83
// Go to previous page
63
84
GridFunctions . navigateToPrevPage ( grid . nativeElement ) ;
64
85
fix . detectChanges ( ) ;
65
- GridFunctions . verifyGridPager ( fix , 3 , '7' , '3\xA0of\xA04' , [ false , false , false , false ] ) ;
86
+ verifyGridPager ( fix , 3 , '7' , '3\xA0of\xA04' , [ false , false , false , false ] ) ;
66
87
67
88
// Go to first page
68
89
GridFunctions . navigateToFirstPage ( grid . nativeElement ) ;
69
90
fix . detectChanges ( ) ;
70
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
91
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
71
92
} ) ;
72
93
73
94
it ( 'should paginate data API' , ( ) => {
@@ -79,30 +100,30 @@ describe('IgxGrid - Grid Paging #grid', () => {
79
100
fix . detectChanges ( ) ;
80
101
81
102
expect ( grid . onPagingDone . emit ) . toHaveBeenCalled ( ) ;
82
- GridFunctions . verifyGridPager ( fix , 3 , '7' , '3\xA0of\xA04' , [ ] ) ;
103
+ verifyGridPager ( fix , 3 , '7' , '3\xA0of\xA04' , [ ] ) ;
83
104
84
105
// Go to next page
85
106
grid . nextPage ( ) ;
86
107
fix . detectChanges ( ) ;
87
108
88
109
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 2 ) ;
89
110
expect ( grid . isLastPage ) . toBe ( true ) ;
90
- GridFunctions . verifyGridPager ( fix , 1 , '10' , '4\xA0of\xA04' , [ ] ) ;
111
+ verifyGridPager ( fix , 1 , '10' , '4\xA0of\xA04' , [ ] ) ;
91
112
92
113
// Go to next page when last page is selected
93
114
grid . nextPage ( ) ;
94
115
fix . detectChanges ( ) ;
95
116
96
117
expect ( grid . isLastPage ) . toBe ( true ) ;
97
118
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 2 ) ;
98
- GridFunctions . verifyGridPager ( fix , 1 , '10' , '4\xA0of\xA04' , [ ] ) ;
119
+ verifyGridPager ( fix , 1 , '10' , '4\xA0of\xA04' , [ ] ) ;
99
120
100
121
// Go to previous page
101
122
grid . previousPage ( ) ;
102
123
fix . detectChanges ( ) ;
103
124
104
125
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 3 ) ;
105
- GridFunctions . verifyGridPager ( fix , 3 , '7' , '3\xA0of\xA04' , [ ] ) ;
126
+ verifyGridPager ( fix , 3 , '7' , '3\xA0of\xA04' , [ ] ) ;
106
127
expect ( grid . isLastPage ) . toBe ( false ) ;
107
128
expect ( grid . isFirstPage ) . toBe ( false ) ;
108
129
@@ -111,31 +132,31 @@ describe('IgxGrid - Grid Paging #grid', () => {
111
132
fix . detectChanges ( ) ;
112
133
113
134
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 4 ) ;
114
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
135
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
115
136
expect ( grid . isFirstPage ) . toBe ( true ) ;
116
137
117
138
// Go to previous page when first page is selected
118
139
grid . previousPage ( ) ;
119
140
fix . detectChanges ( ) ;
120
141
121
142
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 4 ) ;
122
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
143
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
123
144
expect ( grid . isFirstPage ) . toBe ( true ) ;
124
145
125
146
// Go to negative page number
126
147
grid . paginate ( - 3 ) ;
127
148
fix . detectChanges ( ) ;
128
149
129
150
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 4 ) ;
130
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
151
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
131
152
} ) ;
132
153
133
154
it ( 'change paging settings UI' , ( ) => {
134
155
135
156
expect ( grid . paging ) . toBeTruthy ( ) ;
136
157
expect ( grid . perPage ) . toEqual ( 3 , 'Invalid page size' ) ;
137
158
138
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
159
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ ] ) ;
139
160
140
161
// Change page size
141
162
GridFunctions . clickOnPageSelectElement ( fix ) ;
@@ -144,7 +165,7 @@ describe('IgxGrid - Grid Paging #grid', () => {
144
165
145
166
expect ( grid . paging ) . toBeTruthy ( ) ;
146
167
expect ( grid . perPage ) . toEqual ( 10 , 'Invalid page size' ) ;
147
- GridFunctions . verifyGridPager ( fix , 10 , '1' , '1\xA0of\xA01' , [ ] ) ;
168
+ verifyGridPager ( fix , 10 , '1' , '1\xA0of\xA01' , [ ] ) ;
148
169
} ) ;
149
170
150
171
it ( 'change paging settings API' , ( ) => {
@@ -155,15 +176,15 @@ describe('IgxGrid - Grid Paging #grid', () => {
155
176
156
177
expect ( grid . paging ) . toBeTruthy ( ) ;
157
178
expect ( grid . perPage ) . toEqual ( 2 , 'Invalid page size' ) ;
158
- GridFunctions . verifyGridPager ( fix , 2 , '1' , '1\xA0of\xA05' , [ ] ) ;
179
+ verifyGridPager ( fix , 2 , '1' , '1\xA0of\xA05' , [ ] ) ;
159
180
160
181
// Turn off paging
161
182
grid . paging = false ;
162
183
fix . detectChanges ( ) ;
163
184
164
185
expect ( grid . paging ) . toBeFalsy ( ) ;
165
186
expect ( grid . perPage ) . toEqual ( 2 , 'Invalid page size after paging was turned off' ) ;
166
- GridFunctions . verifyGridPager ( fix , 10 , '1' , null , [ ] ) ;
187
+ verifyGridPager ( fix , 10 , '1' , null , [ ] ) ;
167
188
expect ( GridFunctions . getGridPaginator ( grid ) ) . toBeNull ( ) ;
168
189
expect ( grid . nativeElement . querySelectorAll ( '.igx-paginator > select' ) . length ) . toEqual ( 0 ) ;
169
190
} ) ;
@@ -181,7 +202,7 @@ describe('IgxGrid - Grid Paging #grid', () => {
181
202
182
203
expect ( grid . paging ) . toBeTruthy ( ) ;
183
204
expect ( grid . perPage ) . toEqual ( 2 , 'Invalid page size' ) ;
184
- GridFunctions . verifyGridPager ( fix , 2 , '3' , '2\xA0of\xA05' , [ ] ) ;
205
+ verifyGridPager ( fix , 2 , '3' , '2\xA0of\xA05' , [ ] ) ;
185
206
186
207
// Change page size to be 5
187
208
spyOn ( grid . onPagingDone , 'emit' ) ;
@@ -190,7 +211,7 @@ describe('IgxGrid - Grid Paging #grid', () => {
190
211
fix . detectChanges ( ) ;
191
212
let vScrollBar = grid . verticalScrollContainer . getScroll ( ) ;
192
213
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 1 ) ;
193
- GridFunctions . verifyGridPager ( fix , 5 , '1' , '1\xA0of\xA02' , [ true , true , false , false ] ) ;
214
+ verifyGridPager ( fix , 5 , '1' , '1\xA0of\xA02' , [ true , true , false , false ] ) ;
194
215
expect ( vScrollBar . scrollHeight ) . toBeGreaterThanOrEqual ( 250 ) ;
195
216
expect ( vScrollBar . scrollHeight ) . toBeLessThanOrEqual ( 255 ) ;
196
217
@@ -201,7 +222,7 @@ describe('IgxGrid - Grid Paging #grid', () => {
201
222
vScrollBar = grid . verticalScrollContainer . getScroll ( ) ;
202
223
// onPagingDone should be emitted only if we have a change in the page number
203
224
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 1 ) ;
204
- GridFunctions . verifyGridPager ( fix , 5 , '1' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
225
+ verifyGridPager ( fix , 5 , '1' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
205
226
expect ( vScrollBar . scrollHeight ) . toBeGreaterThanOrEqual ( 500 ) ;
206
227
expect ( vScrollBar . scrollHeight ) . toBeLessThanOrEqual ( 510 ) ;
207
228
@@ -210,7 +231,7 @@ describe('IgxGrid - Grid Paging #grid', () => {
210
231
await wait ( ) ;
211
232
fix . detectChanges ( ) ;
212
233
expect ( grid . onPagingDone . emit ) . toHaveBeenCalledTimes ( 1 ) ;
213
- GridFunctions . verifyGridPager ( fix , 5 , '1' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
234
+ verifyGridPager ( fix , 5 , '1' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
214
235
expect ( vScrollBar . scrollHeight ) . toBeGreaterThanOrEqual ( 500 ) ;
215
236
expect ( vScrollBar . scrollHeight ) . toBeLessThanOrEqual ( 510 ) ;
216
237
} ) ) ;
@@ -263,17 +284,17 @@ describe('IgxGrid - Grid Paging #grid', () => {
263
284
// Filter column
264
285
grid . filter ( 'ID' , 1 , IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) ) ;
265
286
fix . detectChanges ( ) ;
266
- GridFunctions . verifyGridPager ( fix , 3 , '2' , '1\xA0of\xA03' , [ true , true , false , false ] ) ;
287
+ verifyGridPager ( fix , 3 , '2' , '1\xA0of\xA03' , [ true , true , false , false ] ) ;
267
288
268
289
// Filter column
269
290
grid . filter ( 'ID' , 1 , IgxNumberFilteringOperand . instance ( ) . condition ( 'equals' ) ) ;
270
291
fix . detectChanges ( ) ;
271
- GridFunctions . verifyGridPager ( fix , 1 , '1' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
292
+ verifyGridPager ( fix , 1 , '1' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
272
293
273
294
// Reset filters
274
295
grid . clearFilter ( 'ID' ) ;
275
296
fix . detectChanges ( ) ;
276
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
297
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
277
298
} ) ;
278
299
279
300
it ( 'should work correct with crud operations' , ( ) => {
@@ -284,49 +305,49 @@ describe('IgxGrid - Grid Paging #grid', () => {
284
305
// Delete first row
285
306
grid . deleteRow ( 1 ) ;
286
307
fix . detectChanges ( ) ;
287
- GridFunctions . verifyGridPager ( fix , 3 , '2' , '1\xA0of\xA03' , [ true , true , false , false ] ) ;
308
+ verifyGridPager ( fix , 3 , '2' , '1\xA0of\xA03' , [ true , true , false , false ] ) ;
288
309
expect ( grid . totalPages ) . toBe ( 3 ) ;
289
310
290
311
// Delete all rows on first page
291
312
grid . deleteRow ( 2 ) ;
292
313
grid . deleteRow ( 3 ) ;
293
314
grid . deleteRow ( 4 ) ;
294
315
fix . detectChanges ( ) ;
295
- GridFunctions . verifyGridPager ( fix , 3 , '5' , '1\xA0of\xA02' , [ ] ) ;
316
+ verifyGridPager ( fix , 3 , '5' , '1\xA0of\xA02' , [ ] ) ;
296
317
expect ( grid . totalPages ) . toBe ( 2 ) ;
297
318
298
319
// Delete all rows on first page
299
320
grid . deleteRow ( 5 ) ;
300
321
grid . deleteRow ( 6 ) ;
301
322
grid . deleteRow ( 7 ) ;
302
323
fix . detectChanges ( ) ;
303
- GridFunctions . verifyGridPager ( fix , 3 , '8' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
324
+ verifyGridPager ( fix , 3 , '8' , '1\xA0of\xA01' , [ true , true , true , true ] ) ;
304
325
expect ( grid . totalPages ) . toBe ( 1 ) ;
305
326
306
327
// Add new row
307
328
grid . addRow ( { ID : 1 , Name : 'Test Name' , JobTitle : 'Test Job Title' } ) ;
308
329
fix . detectChanges ( ) ;
309
- GridFunctions . verifyGridPager ( fix , 3 , '8' , '1\xA0of\xA02' , [ true , true , false , false ] ) ;
330
+ verifyGridPager ( fix , 3 , '8' , '1\xA0of\xA02' , [ true , true , false , false ] ) ;
310
331
expect ( grid . totalPages ) . toBe ( 2 ) ;
311
332
312
333
grid . nextPage ( ) ;
313
334
fix . detectChanges ( ) ;
314
- GridFunctions . verifyGridPager ( fix , 1 , '1' , '2\xA0of\xA02' , [ ] ) ;
335
+ verifyGridPager ( fix , 1 , '1' , '2\xA0of\xA02' , [ ] ) ;
315
336
316
337
// Add new rows on second page
317
338
grid . addRow ( { ID : 2 , Name : 'Test Name' , JobTitle : 'Test Job Title' } ) ;
318
339
grid . addRow ( { ID : 3 , Name : 'Test Name' , JobTitle : 'Test Job Title' } ) ;
319
340
grid . addRow ( { ID : 4 , Name : 'Test Name' , JobTitle : 'Test Job Title' } ) ;
320
341
fix . detectChanges ( ) ;
321
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '2\xA0of\xA03' , [ false , false , false , false ] ) ;
342
+ verifyGridPager ( fix , 3 , '1' , '2\xA0of\xA03' , [ false , false , false , false ] ) ;
322
343
expect ( grid . totalPages ) . toBe ( 3 ) ;
323
344
324
345
// Go to last page and delete the row
325
346
grid . nextPage ( ) ;
326
347
fix . detectChanges ( ) ;
327
348
grid . deleteRow ( 4 ) ;
328
349
fix . detectChanges ( ) ;
329
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '2\xA0of\xA02' , [ false , false , true , true ] ) ;
350
+ verifyGridPager ( fix , 3 , '1' , '2\xA0of\xA02' , [ false , false , true , true ] ) ;
330
351
} ) ;
331
352
332
353
it ( 'should not throw when initialized in a grid with % height' , ( ) => {
@@ -338,16 +359,80 @@ describe('IgxGrid - Grid Paging #grid', () => {
338
359
} ) ;
339
360
340
361
it ( '"paginate" method should paginate correctly' , ( ) => {
341
- GridFunctions . testPagingAPI ( fix , grid , ( pageIndex ) => grid . paginate ( pageIndex ) ) ;
362
+ const page = ( index : number ) => grid . paginate ( index ) ;
363
+ let desiredPageIndex = 2 ;
364
+ page ( 2 ) ;
365
+ fix . detectChanges ( ) ;
366
+
367
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
368
+
369
+ // non-existent page, should not paginate
370
+ page ( - 2 ) ;
371
+ fix . detectChanges ( ) ;
372
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
373
+
374
+ // non-existent page, should not paginate
375
+ page ( 666 ) ;
376
+ fix . detectChanges ( ) ;
377
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
378
+
379
+ // first page
380
+ desiredPageIndex = 0 ;
381
+ page ( desiredPageIndex ) ;
382
+ fix . detectChanges ( ) ;
383
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
384
+
385
+ // last page
386
+ desiredPageIndex = grid . totalPages - 1 ;
387
+ page ( desiredPageIndex ) ;
388
+ fix . detectChanges ( ) ;
389
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
390
+
391
+ // last page + 1, should not paginate
392
+ page ( grid . totalPages ) ;
393
+ fix . detectChanges ( ) ;
394
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
342
395
} ) ;
343
396
344
397
it ( '"page" property should paginate correctly' , ( ) => {
345
- GridFunctions . testPagingAPI ( fix , grid , ( pageIndex ) => grid . page = pageIndex ) ;
398
+ const page = ( index : number ) => grid . page = index ;
399
+ let desiredPageIndex = 2 ;
400
+ page ( 2 ) ;
401
+ fix . detectChanges ( ) ;
402
+
403
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
404
+
405
+ // non-existent page, should not paginate
406
+ page ( - 2 ) ;
407
+ fix . detectChanges ( ) ;
408
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
409
+
410
+ // non-existent page, should not paginate
411
+ page ( 666 ) ;
412
+ fix . detectChanges ( ) ;
413
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
414
+
415
+ // first page
416
+ desiredPageIndex = 0 ;
417
+ page ( desiredPageIndex ) ;
418
+ fix . detectChanges ( ) ;
419
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
420
+
421
+ // last page
422
+ desiredPageIndex = grid . totalPages - 1 ;
423
+ page ( desiredPageIndex ) ;
424
+ fix . detectChanges ( ) ;
425
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
426
+
427
+ // last page + 1, should not paginate
428
+ page ( grid . totalPages ) ;
429
+ fix . detectChanges ( ) ;
430
+ expect ( grid . page ) . toBe ( desiredPageIndex ) ;
346
431
} ) ;
347
432
348
433
it ( 'should hide paginator when there is no data or all records are filtered out.' , ( ) => {
349
434
350
- GridFunctions . verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
435
+ verifyGridPager ( fix , 3 , '1' , '1\xA0of\xA04' , [ true , true , false , false ] ) ;
351
436
352
437
// Filter out all records
353
438
grid . filter ( 'ID' , 1000 , IgxNumberFilteringOperand . instance ( ) . condition ( 'greaterThan' ) ) ;
@@ -386,28 +471,28 @@ describe('IgxGrid - Grid Paging #grid', () => {
386
471
expect ( grid . paging ) . toBeTruthy ( ) ;
387
472
expect ( grid . page ) . toEqual ( 0 ) ;
388
473
expect ( grid . perPage ) . toMatch ( '4' , 'Invalid page size' ) ;
389
- GridFunctions . verifyGridPager ( fix , 4 , '1' , '1\xA0of\xA03' , [ ] ) ;
474
+ verifyGridPager ( fix , 4 , '1' , '1\xA0of\xA03' , [ ] ) ;
390
475
391
476
// Next page button click
392
477
GridFunctions . clickOnPaginatorButton ( nextBtn ) ;
393
478
fix . detectChanges ( ) ;
394
479
395
480
expect ( grid . page ) . toEqual ( 1 , 'Invalid page index' ) ;
396
- GridFunctions . verifyGridPager ( fix , 4 , '5' , '2\xA0of\xA03' , [ ] ) ;
481
+ verifyGridPager ( fix , 4 , '5' , '2\xA0of\xA03' , [ ] ) ;
397
482
398
483
// Previous page button click
399
484
GridFunctions . clickOnPaginatorButton ( prevBtn ) ;
400
485
fix . detectChanges ( ) ;
401
486
402
487
expect ( grid . page ) . toEqual ( 0 , 'Invalid page index' ) ;
403
- GridFunctions . verifyGridPager ( fix , 4 , '1' , '1\xA0of\xA03' , [ ] ) ;
488
+ verifyGridPager ( fix , 4 , '1' , '1\xA0of\xA03' , [ ] ) ;
404
489
405
490
// Go to 3rd page button click
406
491
GridFunctions . clickOnPaginatorButton ( idxPageBtn ) ;
407
492
fix . detectChanges ( ) ;
408
493
409
494
expect ( grid . page ) . toEqual ( 2 , 'Invalid page index' ) ;
410
- GridFunctions . verifyGridPager ( fix , 2 , '9' , '3\xA0of\xA03' , [ ] ) ;
495
+ verifyGridPager ( fix , 2 , '9' , '3\xA0of\xA03' , [ ] ) ;
411
496
} ) ;
412
497
413
498
it ( 'should not throw error when data is undefined' , fakeAsync ( ( ) => {
0 commit comments