Commit d301791c authored by Phil Hughes's avatar Phil Hughes

Added tests

parent e796555b
......@@ -67,9 +67,9 @@ module DropdownsHelper
end
end
def dropdown_filter(placeholder)
def dropdown_filter(placeholder, search_id: nil)
content_tag :div, class: "dropdown-input" do
filter_output = search_field_tag nil, nil, class: "dropdown-input-field", placeholder: placeholder
filter_output = search_field_tag search_id, nil, class: "dropdown-input-field", placeholder: placeholder
filter_output << icon('search', class: "dropdown-input-search")
filter_output << icon('times', class: "dropdown-input-clear js-dropdown-input-clear", role: "button")
......
......@@ -4,7 +4,7 @@
- filter_placeholder = local_assigns.fetch(:filter_placeholder, 'Search labels')
.dropdown-page-one
= dropdown_title(title)
= dropdown_filter(filter_placeholder)
= dropdown_filter(filter_placeholder, search_id: "label-name")
= dropdown_content
- if @project && show_footer
= dropdown_footer do
......
......@@ -199,4 +199,19 @@ feature 'Issue filtering by Labels', feature: true do
end
end
end
context 'dropdown filtering', js: true do
it 'should filter by label name' do
page.within '.labels-filter' do
click_button 'Label'
wait_for_ajax
fill_in 'label-name', with: 'bug'
page.within '.dropdown-content' do
expect(page).not_to have_content 'enhancement'
expect(page).to have_content 'bug'
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment