diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-09-24 17:38:51 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-09-24 17:38:51 +0300 |
commit | 4007456808a9d18858b2c117b9cc6fee91d26ed6 (patch) | |
tree | f76686435113745ecce38325c94848f305c892f4 /spec/features | |
parent | 842ed384075b74207d80a03565e71819fc61932b (diff) | |
parent | 370f07361c6d0fb1565003ae9427f69ad6004009 (diff) |
Merge branch '24128-fix-comment-unresolve-discussions' into 'master'
Resolve "Resolved discussions automatically get unresolved when commented on"
Closes #24128
See merge request gitlab-org/gitlab-ce!21881
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb | 79 |
1 files changed, 49 insertions, 30 deletions
diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index 2d268ecab58..8a16c011067 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -139,44 +139,64 @@ describe 'Merge request > User resolves diff notes and discussions', :js do expect(find('.diffs .diff-file .notes_holder')).to be_visible end end - end - it 'allows user to resolve from reply form without a comment' do - page.within '.diff-content' do - click_button 'Reply...' + describe 'reply form' do + before do + click_button 'Toggle discussion' - click_button 'Resolve discussion' - end + page.within '.diff-content' do + click_button 'Reply...' + end + end - page.within '.line-resolve-all-container' do - expect(page).to have_content('1/1 discussion resolved') - expect(page).to have_selector('.line-resolve-btn.is-active') - end - end + it 'allows user to comment' do + page.within '.diff-content' do + find('.js-note-text').set 'testing' - it 'allows user to unresolve from reply form without a comment' do - page.within '.diff-content' do - click_button 'Resolve discussion' - sleep 1 + click_button 'Comment' - click_button 'Reply...' + wait_for_requests + end - click_button 'Unresolve discussion' - end + page.within '.line-resolve-all-container' do + expect(page).to have_content('1/1 discussion resolved') + end + end - page.within '.line-resolve-all-container' do - expect(page).to have_content('0/1 discussion resolved') - expect(page).not_to have_selector('.line-resolve-btn.is-active') + it 'allows user to unresolve from reply form without a comment' do + page.within '.diff-content' do + click_button 'Unresolve discussion' + + wait_for_requests + end + + page.within '.line-resolve-all-container' do + expect(page).to have_content('0/1 discussion resolved') + expect(page).not_to have_selector('.line-resolve-btn.is-active') + end + end + + it 'allows user to comment & unresolve discussion' do + page.within '.diff-content' do + find('.js-note-text').set 'testing' + + click_button 'Comment & unresolve discussion' + + wait_for_requests + end + + page.within '.line-resolve-all-container' do + expect(page).to have_content('0/1 discussion resolved') + end + end end end - it 'allows user to comment & resolve discussion' do + it 'allows user to resolve from reply form without a comment' do page.within '.diff-content' do click_button 'Reply...' - find('.js-note-text').set 'testing' - - click_button 'Comment & resolve discussion' + click_button 'Resolve discussion' end page.within '.line-resolve-all-container' do @@ -185,19 +205,18 @@ describe 'Merge request > User resolves diff notes and discussions', :js do end end - it 'allows user to comment & unresolve discussion' do + it 'allows user to comment & resolve discussion' do page.within '.diff-content' do - click_button 'Resolve discussion' - click_button 'Reply...' find('.js-note-text').set 'testing' - click_button 'Comment & unresolve discussion' + click_button 'Comment & resolve discussion' end page.within '.line-resolve-all-container' do - expect(page).to have_content('0/1 discussion resolved') + expect(page).to have_content('1/1 discussion resolved') + expect(page).to have_selector('.line-resolve-btn.is-active') end end |