@@ -91,20 +91,35 @@ describe('table pagination', () => {
91
91
} ) ;
92
92
93
93
describe ( 'with the text input box' , ( ) => {
94
- it ( 'correctly navigates to the desired page' , ( ) => {
95
- cy . get ( 'input.current-page' ) . click ( ) ;
96
- DOM . focused . type ( `14` ) ;
97
- cy . get ( 'input.current-page' ) . blur ( ) ;
98
-
99
- cy . get ( 'button.first-page' ) . should ( 'not.be.disabled' ) ;
100
- cy . get ( 'button.previous-page' ) . should ( 'not.be.disabled' ) ;
101
- cy . get ( 'input.current-page' ) . should ( 'have.attr' , 'placeholder' , '14' ) ;
102
- cy . get ( '.last-page' ) . should ( 'have.html' , '29' ) ;
103
- cy . get ( 'button.next-page' ) . should ( 'not.be.disabled' ) ;
104
- cy . get ( 'button.last-page' ) . should ( 'not.be.disabled' ) ;
94
+ describe ( 'correctly navigates to the desired page' , ( ) => {
95
+ it ( 'with unfocus' , ( ) => {
96
+ cy . get ( 'input.current-page' ) . click ( ) ;
97
+ DOM . focused . type ( `14` ) ;
98
+ cy . get ( 'input.current-page' ) . blur ( ) ;
105
99
106
- DashTable . getCell ( 0 , 0 ) . within ( ( ) => cy . get ( '.dash-cell-value' ) . should ( 'have.html' , '66' ) ) ;
100
+ cy . get ( 'button.first-page' ) . should ( 'not.be.disabled' ) ;
101
+ cy . get ( 'button.previous-page' ) . should ( 'not.be.disabled' ) ;
102
+ cy . get ( 'input.current-page' ) . should ( 'have.attr' , 'placeholder' , '14' ) ;
103
+ cy . get ( '.last-page' ) . should ( 'have.html' , '29' ) ;
104
+ cy . get ( 'button.next-page' ) . should ( 'not.be.disabled' ) ;
105
+ cy . get ( 'button.last-page' ) . should ( 'not.be.disabled' ) ;
107
106
107
+ DashTable . getCell ( 0 , 0 ) . within ( ( ) => cy . get ( '.dash-cell-value' ) . should ( 'have.html' , '66' ) ) ;
108
+ } ) ,
109
+ it ( 'with enter' , ( ) => {
110
+ cy . get ( 'input.current-page' ) . click ( ) ;
111
+ DOM . focused . type ( `18${ Key . Enter } ` ) ;
112
+
113
+ cy . get ( 'button.first-page' ) . should ( 'not.be.disabled' ) ;
114
+ cy . get ( 'button.previous-page' ) . should ( 'not.be.disabled' ) ;
115
+ cy . get ( 'input.current-page' ) . should ( 'have.attr' , 'placeholder' , '18' ) ;
116
+ cy . get ( 'input.current-page' ) . should ( 'not.be.focused' ) ;
117
+ cy . get ( '.last-page' ) . should ( 'have.html' , '29' ) ;
118
+ cy . get ( 'button.next-page' ) . should ( 'not.be.disabled' ) ;
119
+ cy . get ( 'button.last-page' ) . should ( 'not.be.disabled' ) ;
120
+
121
+ DashTable . getCell ( 0 , 0 ) . within ( ( ) => cy . get ( '.dash-cell-value' ) . should ( 'have.html' , '86' ) ) ;
122
+ } )
108
123
} ) ;
109
124
110
125
describe ( 'can handle invalid page numbers' , ( ) => {
0 commit comments