diff --git a/spec/features/merge_requests/diff_notes_resolve_spec.rb b/spec/features/merge_requests/diff_notes_resolve_spec.rb index c6adf7e4c56..5e6d8467217 100644 --- a/spec/features/merge_requests/diff_notes_resolve_spec.rb +++ b/spec/features/merge_requests/diff_notes_resolve_spec.rb @@ -194,12 +194,12 @@ feature 'Diff notes resolve', feature: true, js: true do context 'multiple notes' do before do create(:diff_note_on_merge_request, project: project, noteable: merge_request) + visit_merge_request end it 'does not mark discussion as resolved when resolving single note' do - page.within '.diff-content .note' do + page.first '.diff-content .note' do first('.line-resolve-btn').click - sleep 1 expect(first('.line-resolve-btn')['data-original-title']).to eq("Resolved by #{user.name}") end @@ -212,7 +212,9 @@ feature 'Diff notes resolve', feature: true, js: true do it 'resolves discussion' do page.all('.note').each do |note| - note.find('.line-resolve-btn').click + note.all('.line-resolve-btn').each do |button| + button.click + end end expect(page).to have_content('Resolved by') @@ -292,7 +294,7 @@ feature 'Diff notes resolve', feature: true, js: true do expect(holder).to have_selector('.discussion-next-btn') end end - + it 'displays next discussion even if hidden' do page.all('.note-discussion').each do |discussion| page.within discussion do