Commit a7750f1b authored by Eric Eastwood's avatar Eric Eastwood

Enable autocomplete on project snippets

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1210 disabled
autocomplete for personal snippets and project snippets. But we want
autocomplete on project snippets.
parent 025cbc2a
...@@ -226,6 +226,8 @@ import initSettingsPanels from './settings_panels'; ...@@ -226,6 +226,8 @@ import initSettingsPanels from './settings_panels';
case 'projects:snippets:edit': case 'projects:snippets:edit':
case 'projects:snippets:create': case 'projects:snippets:create':
case 'projects:snippets:update': case 'projects:snippets:update':
new gl.GLForm($('.snippet-form'), true);
break;
case 'snippets:new': case 'snippets:new':
case 'snippets:edit': case 'snippets:edit':
case 'snippets:create': case 'snippets:create':
......
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
.row-content-block.top-block.content-component-block .row-content-block.top-block.content-component-block
= render 'award_emoji/awards_block', awardable: @snippet, inline: true = render 'award_emoji/awards_block', awardable: @snippet, inline: true
#notes= render "shared/notes/notes_with_form", :autocomplete => false #notes= render "shared/notes/notes_with_form", :autocomplete => true
...@@ -33,20 +33,11 @@ describe 'Project snippets', :js, feature: true do ...@@ -33,20 +33,11 @@ describe 'Project snippets', :js, feature: true do
visit namespace_project_snippet_path(project.namespace, project, snippets[0]) visit namespace_project_snippet_path(project.namespace, project, snippets[0])
end end
it 'should not have autocomplete' do it 'should have autocomplete' do
wait_for_requests
request_count_before = page.driver.network_traffic.count
find('#note_note').native.send_keys('') find('#note_note').native.send_keys('')
fill_in 'note[note]', with: '@' fill_in 'note[note]', with: '@'
wait_for_requests expect(page).to have_selector('.atwho-view')
request_count_after = page.driver.network_traffic.count
# This selector probably won't be in place even if autocomplete was enabled
# but we want to make sure
expect(page).not_to have_selector('.atwho-view')
expect(request_count_before).to eq(request_count_after)
end end
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