Commit 735731a5 authored by Phil Hughes's avatar Phil Hughes

Tests update

parent cc88fa4d
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
- if selected - if selected
- selected.each do |label| - selected.each do |label|
= hidden_field_tag data_options[:field_name], use_id ? label.try(:id) : u(label.try(:title)), id: nil = hidden_field_tag data_options[:field_name], use_id ? label.try(:id) : label.try(:title), id: nil
.dropdown .dropdown
%button.dropdown-menu-toggle.js-label-select.js-multiselect{class: classes.join(' '), type: "button", data: dropdown_data} %button.dropdown-menu-toggle.js-label-select.js-multiselect{class: classes.join(' '), type: "button", data: dropdown_data}
......
...@@ -110,30 +110,37 @@ describe 'Filter issues', feature: true do ...@@ -110,30 +110,37 @@ describe 'Filter issues', feature: true do
end end
it "filters by `won't fix` and another label" do it "filters by `won't fix` and another label" do
find('.dropdown-menu-labels a', text: label.title).click
page.within '.labels-filter' do page.within '.labels-filter' do
expect(page).to have_content wontfix.title
click_link wontfix.title click_link wontfix.title
expect(page).to have_content wontfix.title
click_link label.title
end end
expect(find('.js-label-select .dropdown-toggle-text')).to have_content(wontfix.title) expect(find('.js-label-select .dropdown-toggle-text')).to have_content("#{wontfix.title} +1 more")
end end
it "filters by `won't fix` label followed by another label after page load" do it "filters by `won't fix` label followed by another label after page load" do
find('.dropdown-menu-labels a', text: wontfix.title).click page.within '.labels-filter' do
# Close label dropdown to load click_link wontfix.title
expect(page).to have_content wontfix.title
end
find('body').click find('body').click
expect(find('.filtered-labels')).to have_content(wontfix.title) expect(find('.filtered-labels')).to have_content(wontfix.title)
find('.js-label-select').click find('.js-label-select').click
wait_for_ajax wait_for_ajax
find('.dropdown-menu-labels a', text: label.title).click find('.dropdown-menu-labels a', text: label.title).click
# Close label dropdown to load
find('body').click find('body').click
expect(find('.filtered-labels')).to have_content(wontfix.title)
expect(find('.filtered-labels')).to have_content(label.title) expect(find('.filtered-labels')).to have_content(label.title)
find('.js-label-select').click find('.js-label-select').click
wait_for_ajax wait_for_ajax
expect(find('.dropdown-menu-labels li', text: wontfix.title)).to have_css('.is-active') expect(find('.dropdown-menu-labels li', text: wontfix.title)).to have_css('.is-active')
expect(find('.dropdown-menu-labels li', text: label.title)).to have_css('.is-active') expect(find('.dropdown-menu-labels li', text: label.title)).to have_css('.is-active')
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