summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-10-20 10:40:27 +0000
committerWinnie Hellmann <winnie@gitlab.com>2017-10-20 13:18:20 +0000
commit8b744b21f3725eb6772f8750c8b76d4593215f04 (patch)
treee9a9184437900d093dd2b9a07f57d06dcead3390 /spec
parenta91eb65570127039af177a785bf023eb3ad6d0be (diff)
downloadgitlab-ce-8b744b21f3725eb6772f8750c8b76d4593215f04.tar.gz
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 (cherry picked from commit 9c3f094a2f7609386ed182e4d5f6f9e7f6938388) 9487cadf Force non diff resolved discussion to display when collapse toggled 1c4f42a4 Add spec f6304f16 Add changelog
Diffstat (limited to 'spec')
-rw-r--r--spec/support/features/discussion_comments_shared_example.rb29
1 files changed, 23 insertions, 6 deletions
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'