Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1079 - added functional tests for URL and search box update up… #1080

Merged
merged 1 commit into from
Jun 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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