Skip to content

Commit f1c1620

Browse files
author
Mike Taylor
committed
Merge pull request #1080 from webcompat/Issue/1079/1
Fixes #1079 - added functional tests for URL and search box update up…
2 parents 13e31e2 + cbe8624 commit f1c1620

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

tests/functional/search-non-auth.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ define([
5252
},
5353

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

68+
'Clicking on label search adds query parameter to the URL': function() {
69+
return this.remote
70+
.setFindTimeout(intern.config.wc.pageLoadTimeout)
71+
.get(require.toUrl(url('/issues')))
72+
.findByCssSelector('[data-remotename=browser-android]').click()
73+
.end()
74+
.getCurrentUrl()
75+
.then(function(currUrl) {
76+
assert.include(currUrl, 'q=label%3Abrowser-android', 'Url updated with label name');
77+
})
78+
.end();
79+
},
80+
81+
'Clicking on label search updates the search input': function() {
82+
return this.remote
83+
.setFindTimeout(intern.config.wc.pageLoadTimeout)
84+
.get(require.toUrl(url('/issues')))
85+
.findByCssSelector('[data-remotename=browser-android]').click()
86+
.end()
87+
.sleep(2000)
88+
.findById('js-SearchForm-input').getProperty('value')
89+
.then(function(searchText) {
90+
assert.include(searchText, 'label:browser-android', 'Url updated with label name');
91+
})
92+
.end();
93+
},
94+
6995
'Search input is visible': function() {
7096
return this.remote
7197
.get(require.toUrl(url('/issues')))

0 commit comments

Comments
 (0)