Commit 98eabf05 authored by Felipe Artur's avatar Felipe Artur

Fix issuables sort direction button parameters

Fix labels parameter being deleted from filter
when clicking sort direction button on issues/merge requests search bar.
parent 75fc422a
......@@ -166,7 +166,7 @@ module SortingHelper
reverse_sort = issuable_reverse_sort_order_hash[sort_value]
if reverse_sort
reverse_url = page_filter_path(sort: reverse_sort)
reverse_url = page_filter_path(sort: reverse_sort, label: true)
else
reverse_url = '#'
link_class += ' disabled'
......
......@@ -21,7 +21,11 @@ describe SortingHelper do
describe '#issuable_sort_direction_button' do
before do
allow(self).to receive(:request).and_return(double(path: 'http://test.com', query_parameters: {}))
allow(self).to receive(:request).and_return(double(path: 'http://test.com', query_parameters: { label_name: 'test_label' }))
end
it 'keeps label filter param' do
expect(issuable_sort_direction_button('created_date')).to include('label_name=test_label')
end
it 'returns icon with sort-highest when sort is created_date' do
......
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