@@ -86,6 +86,41 @@ define([
86
86
. then ( function ( className ) {
87
87
assert . include ( className , 'is-disabled' , 'Going back from first next click should have disabled prev button' ) ;
88
88
} )
89
+ . end ( )
90
+ } ,
91
+
92
+ 'pagination dropdown tests' : function ( ) {
93
+ return this . remote
94
+ . setFindTimeout ( intern . config . wc . pageLoadTimeout )
95
+ . get ( require . toUrl ( url ) )
96
+ . findByCssSelector ( '.js-dropdown-pagination' ) . isDisplayed ( )
97
+ . then ( function ( isDisplayed ) {
98
+ assert . equal ( isDisplayed , true , 'pagination dropdown container is visible.' ) ;
99
+ } )
100
+ . end ( )
101
+ . findByCssSelector ( '.js-dropdown-pagination .js-dropdown-toggle' ) . click ( )
102
+ . end ( )
103
+ . findByCssSelector ( '.js-dropdown-pagination' ) . getAttribute ( 'class' )
104
+ . then ( function ( className ) {
105
+ assert . include ( className , 'is-active' , 'clicking dropdown adds is-active class' ) ;
106
+ } )
107
+ . end ( )
108
+ . findByCssSelector ( '.js-dropdown-pagination .js-dropdown-options' ) . isDisplayed ( )
109
+ . then ( function ( isDisplayed ) {
110
+ assert . equal ( isDisplayed , true , 'dropdown options are visible.' ) ;
111
+ } )
112
+ . end ( )
113
+ . findByCssSelector ( '.js-dropdown-pagination li.Dropdown-item:nth-child(3) > a:nth-child(1)' ) . click ( )
114
+ . end ( )
115
+ . findByCssSelector ( '.js-dropdown-pagination .Dropdown-label' ) . getVisibleText ( )
116
+ . then ( function ( text ) {
117
+ assert . include ( text , 'Show 100' , 'Clicking first option updated dropdown label' ) ;
118
+ } )
119
+ . end ( )
120
+ . findByCssSelector ( '.IssueItem:nth-child(51)' ) . isDisplayed ( )
121
+ . then ( function ( isDisplayed ) {
122
+ assert . equal ( isDisplayed , true , 'More than 50 issues were loaded.' ) ;
123
+ } )
89
124
. end ( ) ;
90
125
}
91
126
} ) ;
0 commit comments