From 2a9b63310646f3d0f9a6306effce9714cec696ce Mon Sep 17 00:00:00 2001 From: deepthivenkat Date: Wed, 1 Jun 2016 21:22:07 +0200 Subject: [PATCH] Issue #1079 - added functional tests for URL and search box update upon label click in /issues --- tests/functional/search-non-auth.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/functional/search-non-auth.js b/tests/functional/search-non-auth.js index 2089a16ec..b6f139877 100644 --- a/tests/functional/search-non-auth.js +++ b/tests/functional/search-non-auth.js @@ -66,6 +66,35 @@ define([ .end(); }, + 'Clicking on label search adds query parameter to the URL': function() { + var params = '?q=dfjdkfjdkfjkdfjdkjf'; + return this.remote + .setFindTimeout(intern.config.wc.pageLoadTimeout) + .get(require.toUrl(url('/issues') + params)) + .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() { + var params = '?q=dfjdkfjdkfjkdfjdkjf'; + return this.remote + .setFindTimeout(intern.config.wc.pageLoadTimeout) + .get(require.toUrl(url('/issues') + params)) + .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')))