Resolve "Selecting an autofill suggestion for project name will not update the project slug"

This commit is contained in:
Martin Wortschack 2018-10-02 07:46:41 +00:00 committed by Phil Hughes
parent 1883e97e7c
commit 5d709e7e86
3 changed files with 9 additions and 5 deletions

View File

@ -147,7 +147,7 @@ const bindEvents = () => {
$projectImportUrl.keyup(() => deriveProjectPathFromUrl($projectImportUrl));
$projectName.keyup(() => {
$projectName.on('keyup change', () => {
onProjectNameChange($projectName, $projectPath);
hasUserDefinedProjectPath = $projectPath.val().trim().length > 0;
});

View File

@ -0,0 +1,5 @@
---
title: Update project path on project name autofill
merge_request: 22016
author:
type: other

View File

@ -21,8 +21,9 @@ describe 'Import/Export - project import integration test', :js do
context 'when selecting the namespace' do
let(:user) { create(:admin) }
let!(:namespace) { user.namespace }
let(:project_name) { 'Test Project Name' + SecureRandom.hex }
let(:project_path) { 'test-project-path' + SecureRandom.hex }
let(:randomHex) { SecureRandom.hex }
let(:project_name) { 'Test Project Name' + randomHex }
let(:project_path) { 'test-project-name' + randomHex }
context 'prefilled the path' do
it 'user imports an exported project successfully' do
@ -30,7 +31,6 @@ describe 'Import/Export - project import integration test', :js do
select2(namespace.id, from: '#project_namespace_id')
fill_in :project_name, with: project_name, visible: true
fill_in :project_path, with: project_path, visible: true
click_import_project_tab
click_link 'GitLab export'
@ -79,7 +79,6 @@ describe 'Import/Export - project import integration test', :js do
select2(user.namespace.id, from: '#project_namespace_id')
fill_in :project_name, with: project.name, visible: true
fill_in :project_path, with: project.path, visible: true
click_import_project_tab
click_link 'GitLab export'
attach_file('file', file)