diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-06-12 22:42:12 +0300 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-06-19 21:42:12 +0300 |
commit | e51078ecfc4aeae7bdfa0ced45fe0de21c9afd8c (patch) | |
tree | aab5841cb6e17abed46c8d9176978c4484d6b61e /spec | |
parent | dbfafd442ee863e6614d0f6765285fcd06f3d843 (diff) |
Disable autocomplete on snippets comments
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/33594
Was supposedly fixed in MR for
https://gitlab.com/gitlab-org/gitlab-ce/issues/32086 but seeing this pop
up again
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/snippets_spec.rb | 25 | ||||
-rw-r--r-- | spec/features/snippets/notes_on_personal_snippets_spec.rb | 16 |
2 files changed, 40 insertions, 1 deletions
diff --git a/spec/features/projects/snippets_spec.rb b/spec/features/projects/snippets_spec.rb index 18689c17fe9..da46b950440 100644 --- a/spec/features/projects/snippets_spec.rb +++ b/spec/features/projects/snippets_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Project snippets', feature: true do +describe 'Project snippets', :js, feature: true do context 'when the project has snippets' do let(:project) { create(:empty_project, :public) } let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } @@ -26,5 +26,28 @@ describe 'Project snippets', feature: true do expect(page).to have_content(snippets[1].title) end end + + context 'when submitting a note' do + before do + login_as :admin + visit namespace_project_snippet_path(project.namespace, project, snippets[0]) + end + + it 'should not have autocomplete' do + wait_for_requests + request_count_before = page.driver.network_traffic.count + + find('#note_note').native.send_keys('') + fill_in 'note[note]', with: '@' + + wait_for_requests + 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 diff --git a/spec/features/snippets/notes_on_personal_snippets_spec.rb b/spec/features/snippets/notes_on_personal_snippets_spec.rb index 44b0c89fac7..04b596d29a1 100644 --- a/spec/features/snippets/notes_on_personal_snippets_spec.rb +++ b/spec/features/snippets/notes_on_personal_snippets_spec.rb @@ -70,6 +70,22 @@ describe 'Comments on personal snippets', :js, feature: true do expect(find('div#notes')).to have_content('This is awesome!') end + + it 'should not have autocomplete' do + wait_for_requests + request_count_before = page.driver.network_traffic.count + + find('#note_note').native.send_keys('') + fill_in 'note[note]', with: '@' + + wait_for_requests + 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 context 'when editing a note' do |