Merge branch 'fix-non-diff-resolved-discussion' into 'master'

Force non diff resolved discussion to display when collapse toggled

Closes #39187

See merge request gitlab-org/gitlab-ce!14946
This commit is contained in:
Phil Hughes 2017-10-20 10:40:27 +00:00
commit 9c3f094a2f
3 changed files with 29 additions and 7 deletions

View File

@ -44,4 +44,4 @@
= render "discussions/diff_with_notes", discussion: discussion
- else
.panel.panel-default
= render "discussions/notes", discussion: discussion
= render partial: "discussions/notes", locals: { discussion: discussion, disable_collapse_class: true }

View File

@ -0,0 +1,5 @@
---
title: Force non diff resolved discussion to display when collapse toggled
merge_request:
author:
type: fixed

View File

@ -121,14 +121,31 @@ shared_examples 'discussion comments' do |resource_name|
end
end
it 'clicking "Start discussion" will post a discussion' do
find(submit_selector).click
describe 'creating a discussion' do
before do
find(submit_selector).click
find(comments_selector, match: :first)
end
find(comments_selector, match: :first)
new_comment = all(comments_selector).last
it 'clicking "Start discussion" will post a discussion' do
new_comment = all(comments_selector).last
expect(new_comment).to have_content 'a'
expect(new_comment).to have_selector '.discussion'
expect(new_comment).to have_content 'a'
expect(new_comment).to have_selector '.discussion'
end
if resource_name == 'merge request'
it 'shows resolved discussion when toggled' do
click_button "Resolve discussion"
expect(page).to have_selector('.note-row-1', visible: true)
refresh
click_button "Toggle discussion"
expect(page).to have_selector('.note-row-1', visible: true)
end
end
end
if resource_name == 'issue'