summaryrefslogtreecommitdiff
path: root/spec/support/features/discussion_comments_shared_example.rb
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-10-20 10:40:26 +0000
committerPhil Hughes <me@iamphill.com>2017-10-20 10:40:26 +0000
commit04b616a60e4318e95b6d2dd769bc2961cba6caa6 (patch)
tree3902a98efce8847136a4d5b3064317352d73cc17 /spec/support/features/discussion_comments_shared_example.rb
parentbc734d34479dfe80984b851153447ce03d4c93a0 (diff)
downloadgitlab-ce-04b616a60e4318e95b6d2dd769bc2961cba6caa6.tar.gz
Force non diff resolved discussion to display when collapse toggled
Diffstat (limited to 'spec/support/features/discussion_comments_shared_example.rb')
-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'