Skip to content

Commit 952f4d0

Browse files
author
Mike Taylor
committed
Issue #399 - Add tests for stage param manipulation
1 parent 3005d01 commit 952f4d0

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/functional/issue-list.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,58 @@ define([
262262
assert.equal(text, 'Show 25', 'Pagination dropdown label is back to where we started');
263263
})
264264
.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();
265317
}
266318

267319
// 'clicking on a label performs a label search': function() {

0 commit comments

Comments
 (0)