summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-03-09 09:47:01 +0000
committerPhil Hughes <me@iamphill.com>2017-03-09 09:47:01 +0000
commitaa9aa11de549fc2486b4d37ebfad1b3bc63b07d1 (patch)
treeae10d84f20438a9f02fe0af2fc8c2a22b5dca97c
parent2edd42cafc821422076ec3aeaaaebd8f81b7aa4f (diff)
downloadgitlab-ce-diff-avatar-improvements.tar.gz
Added regression testsdiff-avatar-improvements
-rw-r--r--spec/features/merge_requests/diff_notes_avatars_spec.rb50
1 files changed, 50 insertions, 0 deletions
diff --git a/spec/features/merge_requests/diff_notes_avatars_spec.rb b/spec/features/merge_requests/diff_notes_avatars_spec.rb
index 7df102067d6..a6c72b0b3ac 100644
--- a/spec/features/merge_requests/diff_notes_avatars_spec.rb
+++ b/spec/features/merge_requests/diff_notes_avatars_spec.rb
@@ -23,6 +23,56 @@ feature 'Diff note avatars', feature: true, js: true do
login_as user
end
+ context 'discussion tab' do
+ before do
+ visit namespace_project_merge_request_path(project.namespace, project, merge_request)
+ end
+
+ it 'does not show avatars on discussion tab' do
+ expect(page).not_to have_selector('.js-avatar-container')
+ expect(page).not_to have_selector('.diff-comment-avatar-holders')
+ end
+
+ it 'does not render avatars after commening on discussion tab' do
+ click_button 'Reply...'
+
+ page.within('.js-discussion-note-form') do
+ find('.note-textarea').native.send_keys('Test comment')
+
+ click_button 'Comment'
+ end
+
+ expect(page).to have_content('Test comment')
+ expect(page).not_to have_selector('.js-avatar-container')
+ expect(page).not_to have_selector('.diff-comment-avatar-holders')
+ end
+ end
+
+ context 'commit view' do
+ before do
+ visit namespace_project_commit_path(project.namespace, project, merge_request.commits.first.id)
+ end
+
+ it 'does not render avatar after commenting' do
+ first('.diff-line-num').trigger('mouseover')
+ find('.js-add-diff-note-button').click
+
+ page.within('.js-discussion-note-form') do
+ find('.note-textarea').native.send_keys('test comment')
+
+ click_button 'Comment'
+
+ wait_for_ajax
+ end
+
+ visit namespace_project_merge_request_path(project.namespace, project, merge_request)
+
+ expect(page).to have_content('test comment')
+ expect(page).not_to have_selector('.js-avatar-container')
+ expect(page).not_to have_selector('.diff-comment-avatar-holders')
+ end
+ end
+
%w(inline parallel).each do |view|
context "#{view} view" do
before do