summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-10-20 10:40:26 +0000
committerWinnie Hellmann <winnie@gitlab.com>2017-10-21 23:32:05 +0300
commitc02baddf564af5c25824a0f2107aa8e309a4374a (patch)
tree5d90cd1d33ee10a2862c65cf999209430cb220b5
parent018542b19bb676354e2a662a272a7e14cac3183b (diff)
downloadgitlab-ce-c02baddf564af5c25824a0f2107aa8e309a4374a.tar.gz
Force non diff resolved discussion to display when collapse toggled
-rw-r--r--app/views/discussions/_discussion.html.haml2
-rw-r--r--changelogs/unreleased/fix-non-diff-resolved-discussion.yml5
-rw-r--r--spec/support/features/discussion_comments_shared_example.rb29
3 files changed, 29 insertions, 7 deletions
diff --git a/app/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml
index 578e751ab47..0f03163a2e8 100644
--- a/app/views/discussions/_discussion.html.haml
+++ b/app/views/discussions/_discussion.html.haml
@@ -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 }
diff --git a/changelogs/unreleased/fix-non-diff-resolved-discussion.yml b/changelogs/unreleased/fix-non-diff-resolved-discussion.yml
new file mode 100644
index 00000000000..9bff53ea7c9
--- /dev/null
+++ b/changelogs/unreleased/fix-non-diff-resolved-discussion.yml
@@ -0,0 +1,5 @@
+---
+title: Force non diff resolved discussion to display when collapse toggled
+merge_request:
+author:
+type: fixed
diff --git a/spec/support/features/discussion_comments_shared_example.rb b/spec/support/features/discussion_comments_shared_example.rb
index 9f05cabf7ae..7132b9cd221 100644
--- a/spec/support/features/discussion_comments_shared_example.rb
+++ b/spec/support/features/discussion_comments_shared_example.rb
@@ -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
+
+ 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'
+ 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)
- find(comments_selector, match: :first)
- new_comment = all(comments_selector).last
+ refresh
+ click_button "Toggle discussion"
- expect(new_comment).to have_content 'a'
- expect(new_comment).to have_selector '.discussion'
+ expect(page).to have_selector('.note-row-1', visible: true)
+ end
+ end
end
if resource_name == 'issue'