@@ -262,6 +262,58 @@ define([
262
262
assert . equal ( text , 'Show 25' , 'Pagination dropdown label is back to where we started' ) ;
263
263
} )
264
264
. end ( ) ;
265
+ } ,
266
+
267
+ 'clicking on a stage filter adds the correct param to the URL' : function ( ) {
268
+ return this . remote
269
+ . setFindTimeout ( intern . config . wc . pageLoadTimeout )
270
+ . get ( require . toUrl ( url ) )
271
+ . findByCssSelector ( '[data-filter="contactready"]' ) . click ( )
272
+ . end ( )
273
+ // find something so we know the page has loaded
274
+ . findByCssSelector ( '.IssueItem:nth-of-type(1)' )
275
+ . getCurrentUrl ( )
276
+ . then ( function ( currUrl ) {
277
+ assert . include ( currUrl , 'stage=contactready' , 'Stage filter added to URL correctly.' ) ;
278
+ } )
279
+ end ( ) ;
280
+ } ,
281
+
282
+ 'toggling a stage filter doesn\'t leave the param in the URL' : function ( ) {
283
+ return this . remote
284
+ . setFindTimeout ( intern . config . wc . pageLoadTimeout )
285
+ . get ( require . toUrl ( url ) )
286
+ . findByCssSelector ( '[data-filter="closed"]' ) . click ( )
287
+ . end ( )
288
+ // find something so we know the page has loaded
289
+ . findByCssSelector ( '.IssueItem:nth-of-type(1)' )
290
+ . end ( )
291
+ . findByCssSelector ( '[data-filter="closed"]' ) . click ( )
292
+ . end ( )
293
+ . getCurrentUrl ( )
294
+ . then ( function ( currUrl ) {
295
+ assert . notInclude ( currUrl , 'stage=closed' , 'Stage filter added then removed from URL.' ) ;
296
+ } )
297
+ end ( ) ;
298
+ } ,
299
+
300
+ 'toggling between stage filters results in last param in URL' : function ( ) {
301
+ return this . remote
302
+ . setFindTimeout ( intern . config . wc . pageLoadTimeout )
303
+ . get ( require . toUrl ( url ) )
304
+ . findByCssSelector ( '[data-filter="closed"]' ) . click ( )
305
+ . end ( )
306
+ // find something so we know the page has loaded
307
+ . findByCssSelector ( '.IssueItem:nth-of-type(1)' )
308
+ . end ( )
309
+ . findByCssSelector ( '[data-filter="sitewait"]' ) . click ( )
310
+ . end ( )
311
+ . getCurrentUrl ( )
312
+ . then ( function ( currUrl ) {
313
+ assert . include ( currUrl , 'stage=sitewait' , 'Stage filter added to URL correctly.' ) ;
314
+ assert . notInclude ( currUrl , 'stage=closed' , 'Stage removed from URL correctly.' ) ;
315
+ } )
316
+ end ( ) ;
265
317
}
266
318
267
319
// 'clicking on a label performs a label search': function() {
0 commit comments