Filtering by any label keeps the text on the toggle button
This commit is contained in:
parent
122b4148f7
commit
a6ba94dbd1
|
@ -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
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue