@@ -5,7 +5,7 @@ import Select from 'rc-select';
5
5
import React from 'react' ;
6
6
import TestUtils from 'react-dom/test-utils' ;
7
7
import ReactDOM from 'react-dom' ;
8
- import TwoPagination from './helper/ two-pagination' ;
8
+ import TwoPagination from './two-pagination' ;
9
9
10
10
const Simulate = TestUtils . Simulate ;
11
11
@@ -543,62 +543,6 @@ describe('hideOnSinglePage props', () => {
543
543
} ) ;
544
544
} ) ;
545
545
546
- describe ( 'showPrevNextJumpers props' , ( ) => {
547
- const container = document . createElement ( 'div' ) ;
548
- const currentPage = 12 ;
549
- document . body . appendChild ( container ) ;
550
-
551
- afterEach ( ( ) => {
552
- ReactDOM . unmountComponentAtNode ( container ) ;
553
- } ) ;
554
-
555
- it ( 'should hide jump-prev, jump-next if showPrevNextJumpers equals false' , done => {
556
- ReactDOM . render (
557
- < Pagination
558
- total = { 1000 }
559
- current = { currentPage }
560
- showPrevNextJumpers = { false }
561
- /> ,
562
- container ,
563
- function ( ) {
564
- expect ( ( ) => {
565
- TestUtils . findRenderedDOMComponentWithClass (
566
- this ,
567
- 'rc-pagination-jump-prev' ,
568
- ) ;
569
- } ) . to . throwException ( / D i d n o t f i n d e x a c t l y o n e m a t c h / ) ;
570
- expect ( ( ) => {
571
- TestUtils . findRenderedDOMComponentWithClass (
572
- this ,
573
- 'rc-pagination-jump-next' ,
574
- ) ;
575
- } ) . to . throwException ( / D i d n o t f i n d e x a c t l y o n e m a t c h / ) ;
576
- done ( ) ;
577
- } ,
578
- ) ;
579
- } ) ;
580
-
581
- it ( 'should show jump-prev, jump-next if showPrevNextJumpers equals true' , done => {
582
- ReactDOM . render (
583
- < Pagination total = { 1000 } current = { currentPage } showPrevNextJumpers /> ,
584
- container ,
585
- function ( ) {
586
- const jumpPrev = TestUtils . findRenderedDOMComponentWithClass (
587
- this ,
588
- 'rc-pagination-jump-prev' ,
589
- ) ;
590
- const jumpNext = TestUtils . findRenderedDOMComponentWithClass (
591
- this ,
592
- 'rc-pagination-jump-next' ,
593
- ) ;
594
- expect ( TestUtils . isDOMComponent ( jumpPrev ) ) . to . be ( true ) ;
595
- expect ( TestUtils . isDOMComponent ( jumpNext ) ) . to . be ( true ) ;
596
- done ( ) ;
597
- } ,
598
- ) ;
599
- } ) ;
600
- } ) ;
601
-
602
546
describe ( 'custom showQuickJumper button Pagination' , ( ) => {
603
547
let pagination = null ;
604
548
const container = document . createElement ( 'div' ) ;
@@ -1057,69 +1001,3 @@ describe('disabled', () => {
1057
1001
) ;
1058
1002
} ) ;
1059
1003
} ) ;
1060
-
1061
- describe ( 'Pagination with jumper' , ( ) => {
1062
- let pagination = null ;
1063
- const container = document . createElement ( 'div' ) ;
1064
- document . body . appendChild ( container ) ;
1065
-
1066
- let current = 10 ;
1067
- function onChange ( page ) {
1068
- current = page ;
1069
- }
1070
-
1071
- beforeEach ( done => {
1072
- ReactDOM . render (
1073
- < Pagination
1074
- onChange = { onChange }
1075
- defaultCurrent = { 10 }
1076
- total = { 1000 }
1077
- showQuickJumper
1078
- /> ,
1079
- container ,
1080
- function ( ) {
1081
- pagination = this ;
1082
- done ( ) ;
1083
- } ,
1084
- ) ;
1085
- } ) ;
1086
-
1087
- afterEach ( ( ) => {
1088
- ReactDOM . unmountComponentAtNode ( container ) ;
1089
- current = 10 ;
1090
- } ) ;
1091
-
1092
- it ( 'when input less than 1' , done => {
1093
- const quickJumper = TestUtils . findRenderedDOMComponentWithClass (
1094
- pagination ,
1095
- 'rc-pagination-options-quick-jumper' ,
1096
- ) ;
1097
- const input = quickJumper . querySelector ( 'input' ) ;
1098
- expect ( TestUtils . isDOMComponent ( input ) ) . to . be ( true ) ;
1099
- input . value = '-1' ;
1100
- Simulate . change ( input ) ;
1101
- setTimeout ( ( ) => {
1102
- Simulate . keyUp ( input , { key : 'Enter' , keyCode : 13 , which : 13 } ) ;
1103
- setTimeout ( ( ) => {
1104
- expect ( pagination . state . current ) . to . be ( 1 ) ;
1105
- expect ( current ) . to . be ( 1 ) ;
1106
- done ( ) ;
1107
- } , 10 ) ;
1108
- } , 10 ) ;
1109
- } ) ;
1110
-
1111
- it ( 'when input onBlur' , done => {
1112
- const quickJumper = TestUtils . findRenderedDOMComponentWithClass (
1113
- pagination ,
1114
- 'rc-pagination-options-quick-jumper' ,
1115
- ) ;
1116
- const input = quickJumper . querySelector ( 'input' ) ;
1117
- expect ( TestUtils . isDOMComponent ( input ) ) . to . be ( true ) ;
1118
- Simulate . blur ( input ) ;
1119
- setTimeout ( ( ) => {
1120
- expect ( pagination . state . current ) . to . be ( 10 ) ;
1121
- expect ( current ) . to . be ( 10 ) ;
1122
- done ( ) ;
1123
- } , 10 ) ;
1124
- } ) ;
1125
- } ) ;
0 commit comments