Commit a6ba94db authored by Phil Hughes's avatar Phil Hughes

Filtering by any label keeps the text on the toggle button

parent 122b4148
...@@ -218,7 +218,7 @@ class @LabelsSelect ...@@ -218,7 +218,7 @@ class @LabelsSelect
selectable: true selectable: true
toggleLabel: (selected) -> toggleLabel: (selected) ->
if selected and selected.title isnt 'Any Label' if selected and selected.title?
selected.title selected.title
else else
defaultLabel defaultLabel
......
...@@ -84,16 +84,25 @@ describe 'Filter issues', feature: true do ...@@ -84,16 +84,25 @@ describe 'Filter issues', feature: true do
it 'should filter by any label' do it 'should filter by any label' do
find('.dropdown-menu-labels a', text: 'Any Label').click find('.dropdown-menu-labels a', text: 'Any Label').click
page.within '.labels-filter' do
expect(page).to have_content 'Any Label'
end
expect(find('.js-label-select .dropdown-toggle-text')).to have_content('Label') expect(find('.js-label-select .dropdown-toggle-text')).to have_content('Label')
end end
it 'should filter by no label' do it 'should filter by no label' do
find('.dropdown-menu-labels a', text: 'No Label').click find('.dropdown-menu-labels a', text: 'No Label').click
page.within '.labels-filter' do
expect(page).to have_content 'No Label'
end
expect(find('.js-label-select .dropdown-toggle-text')).to have_content('No Label') expect(find('.js-label-select .dropdown-toggle-text')).to have_content('No Label')
end end
it 'should filter by no label' do it 'should filter by no label' do
find('.dropdown-menu-labels a', text: label.title).click find('.dropdown-menu-labels a', text: label.title).click
page.within '.labels-filter' do
expect(page).to have_content label.title
end
expect(find('.js-label-select .dropdown-toggle-text')).to have_content(label.title) expect(find('.js-label-select .dropdown-toggle-text')).to have_content(label.title)
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