Skip to content

Commit

Permalink
Merge pull request #1080 from webcompat/Issue/1079/1
Browse files Browse the repository at this point in the history
Fixes #1079 - added functional tests for URL and search box update up…
  • Loading branch information
Mike Taylor committed Jun 2, 2016
2 parents 13e31e2 + cbe8624 commit f1c1620
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions tests/functional/search-non-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ define([
},

'Clicking on label search suggestion works': function() {
var params = '?q=dfjdkfjdkfjkdfjdkjf';
return this.remote
.setFindTimeout(intern.config.wc.pageLoadTimeout)
.get(require.toUrl(url('/issues') + params))
.get(require.toUrl(url('/issues')))
.findByCssSelector('[data-remotename=browser-android]').click()
.end()
// click the first suggestion, which is "android"
Expand All @@ -66,6 +65,33 @@ define([
.end();
},

'Clicking on label search adds query parameter to the URL': function() {
return this.remote
.setFindTimeout(intern.config.wc.pageLoadTimeout)
.get(require.toUrl(url('/issues')))
.findByCssSelector('[data-remotename=browser-android]').click()
.end()
.getCurrentUrl()
.then(function(currUrl) {
assert.include(currUrl, 'q=label%3Abrowser-android', 'Url updated with label name');
})
.end();
},

'Clicking on label search updates the search input': function() {
return this.remote
.setFindTimeout(intern.config.wc.pageLoadTimeout)
.get(require.toUrl(url('/issues')))
.findByCssSelector('[data-remotename=browser-android]').click()
.end()
.sleep(2000)
.findById('js-SearchForm-input').getProperty('value')
.then(function(searchText) {
assert.include(searchText, 'label:browser-android', 'Url updated with label name');
})
.end();
},

'Search input is visible': function() {
return this.remote
.get(require.toUrl(url('/issues')))
Expand Down

0 comments on commit f1c1620

Please sign in to comment.