summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2016-12-16 01:08:07 -0600
committerClement Ho <ClemMakesApps@gmail.com>2017-01-09 16:01:32 -0600
commitfd90a99639f5685aa86440aba1da6165b623e877 (patch)
tree752d929a253122e9a68e4bd5bb0f1055bbd74b68 /spec
parent625ecdbcc848f05eafaf167255901efd2d32cb37 (diff)
downloadgitlab-ce-fd90a99639f5685aa86440aba1da6165b623e877.tar.gz
Define filtered_search as a variable
Diffstat (limited to 'spec')
-rw-r--r--spec/features/issues/filtered_search/dropdown_hint_spec.rb1
-rw-r--r--spec/features/issues/filtered_search/search_bar_spec.rb7
2 files changed, 2 insertions, 6 deletions
diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb
index 364d4bf4db1..216cd78850b 100644
--- a/spec/features/issues/filtered_search/dropdown_hint_spec.rb
+++ b/spec/features/issues/filtered_search/dropdown_hint_spec.rb
@@ -6,6 +6,7 @@ describe 'Dropdown hint', js: true, feature: true do
let!(:project) { create(:empty_project) }
let!(:user) { create(:user) }
let(:filtered_search) { find('.filtered-search') }
+
before do
project.team << [user, :master]
login_as(user)
diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb
index 5862214cdc3..d37057a44f8 100644
--- a/spec/features/issues/filtered_search/search_bar_spec.rb
+++ b/spec/features/issues/filtered_search/search_bar_spec.rb
@@ -5,6 +5,7 @@ describe 'Search bar', js: true, feature: true do
let!(:project) { create(:empty_project) }
let!(:user) { create(:user) }
+ let(:filtered_search) { find('.filtered-search') }
before do
project.team << [user, :master]
@@ -22,7 +23,6 @@ describe 'Search bar', js: true, feature: true do
describe 'clear search button' do
it 'clears text' do
search_text = 'search_text'
- filtered_search = find('.filtered-search')
filtered_search.set(search_text)
expect(filtered_search.value).to eq(search_text)
@@ -35,28 +35,24 @@ describe 'Search bar', js: true, feature: true do
end
it 'hides after clicked' do
- filtered_search = find('.filtered-search')
filtered_search.set('a')
find('.filtered-search-input-container .clear-search').click
expect(page).to have_css('.clear-search', visible: false)
end
it 'hides when there is no text' do
- filtered_search = find('.filtered-search')
filtered_search.set('a')
filtered_search.set('')
expect(page).to have_css('.clear-search', visible: false)
end
it 'shows when there is text' do
- filtered_search = find('.filtered-search')
filtered_search.set('a')
expect(page).to have_css('.clear-search', visible: true)
end
it 'resets the dropdown hint filter' do
- filtered_search = find('.filtered-search')
filtered_search.click();
original_size = page.all('#js-dropdown-hint .filter-dropdown .filter-dropdown-item').size
@@ -69,7 +65,6 @@ describe 'Search bar', js: true, feature: true do
end
it 'resets the dropdown filters' do
- filtered_search = find('.filtered-search')
filtered_search.set('a')
hintStyle = page.find('#js-dropdown-hint')['style']
hintOffset = getLeftStyle(hintStyle)