2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-04-12 07:30:28 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2019-06-26 07:57:34 -04:00
|
|
|
describe 'Thread Comments Commit', :js do
|
2017-04-12 07:30:28 -04:00
|
|
|
include RepoHelpers
|
|
|
|
|
|
|
|
let(:user) { create(:user) }
|
2017-08-01 14:51:52 -04:00
|
|
|
let(:project) { create(:project, :repository) }
|
2017-04-12 07:30:28 -04:00
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
2019-06-27 03:42:18 -04:00
|
|
|
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-04-12 07:30:28 -04:00
|
|
|
|
|
|
|
before do
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-04-12 07:30:28 -04:00
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_commit_path(project, sample_commit.id)
|
2017-04-12 07:30:28 -04:00
|
|
|
end
|
|
|
|
|
2019-06-26 07:57:34 -04:00
|
|
|
it_behaves_like 'thread comments', 'commit'
|
2019-06-27 03:42:18 -04:00
|
|
|
|
|
|
|
it 'has class .js-note-emoji' do
|
|
|
|
expect(page).to have_css('.js-note-emoji')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'adds award to the correct note' do
|
|
|
|
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-04-12 07:30:28 -04:00
|
|
|
end
|