debian-mirror-gitlab/spec/features/discussion_comments/commit_spec.rb

37 lines
1.2 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'Thread Comments Commit', :js do
2017-08-17 22:00:37 +05:30
include RepoHelpers
let(:user) { create(:user) }
2017-09-10 17:25:29 +05:30
let(:project) { create(:project, :repository) }
2017-08-17 22:00:37 +05:30
let(:merge_request) { create(:merge_request, source_project: project) }
2019-09-30 21:07:59 +05:30
let!(:commit_discussion_note1) { create(:discussion_note_on_commit, project: project) }
let!(:commit_discussion_note2) { create(:discussion_note_on_commit, in_reply_to: commit_discussion_note1) }
2017-08-17 22:00:37 +05:30
before do
2018-11-18 11:00:15 +05:30
project.add_maintainer(user)
2017-09-10 17:25:29 +05:30
sign_in(user)
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
visit project_commit_path(project, sample_commit.id)
2017-08-17 22:00:37 +05:30
end
2021-04-17 20:07:23 +05:30
it_behaves_like 'thread comments for commit and snippet', 'commit'
2019-09-30 21:07:59 +05:30
it 'has class .js-note-emoji' do
expect(page).to have_css('.js-note-emoji')
end
2020-07-28 23:09:34 +05:30
it 'adds award to the correct note', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/207973' do
2019-09-30 21:07:59 +05:30
find("#note_#{commit_discussion_note2.id} .js-note-emoji").click
first('.emoji-menu .js-emoji-btn').click
wait_for_requests
expect(find("#note_#{commit_discussion_note1.id}")).not_to have_css('.js-awards-block')
expect(find("#note_#{commit_discussion_note2.id}")).to have_css('.js-awards-block')
end
2017-08-17 22:00:37 +05:30
end