debian-mirror-gitlab/spec/features/projects/user_sees_user_popover_spec.rb

51 lines
1.1 KiB
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# frozen_string_literal: true
require 'spec_helper'
describe 'User sees user popover', :js do
2020-05-24 23:13:21 +05:30
include Spec::Support::Helpers::Features::NotesHelpers
2020-04-08 14:13:33 +05:30
let_it_be(:project) { create(:project, :repository) }
2020-03-09 13:42:32 +05:30
let(:user) { project.creator }
let(:merge_request) do
create(:merge_request, source_project: project, target_project: project)
end
before do
project.add_maintainer(user)
sign_in(user)
end
subject { page }
describe 'hovering over a user link in a merge request' do
2020-05-24 23:13:21 +05:30
let(:popover_selector) { '.user-popover' }
2020-03-09 13:42:32 +05:30
before do
visit project_merge_request_path(project, merge_request)
end
it 'displays user popover' do
find('.js-user-link').hover
expect(page).to have_css(popover_selector, visible: true)
page.within(popover_selector) do
expect(page).to have_content(user.name)
end
end
2020-05-24 23:13:21 +05:30
it "displays user popover in system note" do
add_note("/assign @#{user.username}")
wait_for_requests
find('.system-note-message .js-user-link').hover
page.within(popover_selector) do
expect(page).to have_content(user.name)
end
end
2020-03-09 13:42:32 +05:30
end
end