Filtering by any label keeps the text on the toggle button

This commit is contained in:
Phil Hughes 2016-04-12 09:32:12 +01:00
parent 122b4148f7
commit a6ba94dbd1
2 changed files with 10 additions and 1 deletions

View File

@ -218,7 +218,7 @@ class @LabelsSelect
selectable: true
toggleLabel: (selected) ->
if selected and selected.title isnt 'Any Label'
if selected and selected.title?
selected.title
else
defaultLabel

View File

@ -84,16 +84,25 @@ describe 'Filter issues', feature: true do
it 'should filter by any label' do
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')
end
it 'should filter by no label' do
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')
end
it 'should filter by no label' do
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)
end
end