@@ -323,7 +323,7 @@ describe('current value on onShowSizeChange when total is 0', () => {
323
323
input . simulate ( 'keyDown' , { key : 'Enter' , keyCode : 13 , which : 13 } ) ;
324
324
expect ( onShowSizeChange ) . toHaveBeenLastCalledWith (
325
325
wrapper . state ( ) . current ,
326
- 25 ,
326
+ 20 ,
327
327
) ;
328
328
} ) ;
329
329
@@ -341,30 +341,67 @@ describe('current value on onShowSizeChange when total is 0', () => {
341
341
const wrapper1 = mount (
342
342
< Pagination
343
343
selectComponentClass = { Select }
344
- total = { 99 }
344
+ total = { 50 }
345
345
/> ,
346
346
) ;
347
347
expect ( wrapper1 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( false ) ;
348
348
const wrapper2 = mount (
349
349
< Pagination
350
350
selectComponentClass = { Select }
351
- total = { 100 }
351
+ total = { 51 }
352
352
/> ,
353
353
) ;
354
354
expect ( wrapper2 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( true ) ;
355
355
const wrapper3 = mount (
356
356
< Pagination
357
357
selectComponentClass = { Select }
358
358
showSizeChanger = { false }
359
+ total = { 51 }
360
+ /> ,
361
+ ) ;
362
+ expect ( wrapper3 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( false ) ;
363
+ const wrapper4 = mount (
364
+ < Pagination
365
+ selectComponentClass = { Select }
366
+ showSizeChanger
367
+ total = { 50 }
368
+ /> ,
369
+ ) ;
370
+ expect ( wrapper4 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( true ) ;
371
+ } ) ;
372
+
373
+ it ( 'totalBoundaryShowSizeChanger works' , ( ) => {
374
+ const wrapper1 = mount (
375
+ < Pagination
376
+ selectComponentClass = { Select }
359
377
total = { 100 }
378
+ totalBoundaryShowSizeChanger = { 100 }
379
+ /> ,
380
+ ) ;
381
+ expect ( wrapper1 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( false ) ;
382
+ const wrapper2 = mount (
383
+ < Pagination
384
+ selectComponentClass = { Select }
385
+ total = { 101 }
386
+ totalBoundaryShowSizeChanger = { 100 }
387
+ /> ,
388
+ ) ;
389
+ expect ( wrapper2 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( true ) ;
390
+ const wrapper3 = mount (
391
+ < Pagination
392
+ selectComponentClass = { Select }
393
+ showSizeChanger = { false }
394
+ total = { 101 }
395
+ totalBoundaryShowSizeChanger = { 100 }
360
396
/> ,
361
397
) ;
362
398
expect ( wrapper3 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( false ) ;
363
399
const wrapper4 = mount (
364
400
< Pagination
365
401
selectComponentClass = { Select }
366
402
showSizeChanger
367
- total = { 99 }
403
+ total = { 100 }
404
+ totalBoundaryShowSizeChanger = { 100 }
368
405
/> ,
369
406
) ;
370
407
expect ( wrapper4 . exists ( '.rc-pagination-options-size-changer' ) ) . toBe ( true ) ;
0 commit comments