Commit 93b246ec authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'mr-creation-source-project-filtering' into 'master'

Fixed source projects not filtering

Closes #52728

See merge request gitlab-org/gitlab-ce!22515
parents eac645d7 63b2b1b4
...@@ -40,7 +40,7 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = ( ...@@ -40,7 +40,7 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = (
}, },
selectable: true, selectable: true,
filterable: true, filterable: true,
filterRemote: true, filterRemote: !!$dropdown.data('refsUrl'),
fieldName: $dropdown.data('fieldName'), fieldName: $dropdown.data('fieldName'),
filterInput: 'input[type="search"]', filterInput: 'input[type="search"]',
renderRow: function(ref) { renderRow: function(ref) {
......
---
title: Fixed source project not filtering in merge request creation compare form
merge_request:
author:
type: fixed
...@@ -28,4 +28,29 @@ describe 'Merge request > User creates MR' do ...@@ -28,4 +28,29 @@ describe 'Merge request > User creates MR' do
it_behaves_like 'a creatable merge request' it_behaves_like 'a creatable merge request'
end end
end end
context 'source project', :js do
let(:user) { create(:user) }
let(:target_project) { create(:project, :public, :repository) }
let(:source_project) { target_project }
before do
source_project.add_maintainer(user)
sign_in(user)
visit project_new_merge_request_path(
target_project,
merge_request: {
source_project_id: source_project.id,
target_project_id: target_project.id
})
end
it 'filters source project' do
find('.js-source-project').click
find('.dropdown-source-project input').set('source')
expect(find('.dropdown-source-project .dropdown-content')).not_to have_content(source_project.name)
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