2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'User sees user popover', :js do
|
2020-05-24 23:13:21 +05:30
|
|
|
include Spec::Support::Helpers::Features::NotesHelpers
|
|
|
|
|
2021-09-30 23:02:18 +05:30
|
|
|
let_it_be(:user) { create(:user, pronouns: 'they/them') }
|
|
|
|
let_it_be(:project) { create(:project, :repository, creator: user) }
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
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-07-28 23:09:34 +05:30
|
|
|
let(:popover_selector) { '[data-testid="user-popover"]' }
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2020-03-13 15:44:24 +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
|
2021-09-30 23:02:18 +05:30
|
|
|
expect(page).to have_content("#{user.name} (they/them)")
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
it 'displays user popover in system note', :sidekiq_inline do
|
2020-05-24 23:13:21 +05:30
|
|
|
add_note("/assign @#{user.username}")
|
|
|
|
|
|
|
|
find('.system-note-message .js-user-link').hover
|
|
|
|
|
|
|
|
page.within(popover_selector) do
|
|
|
|
expect(page).to have_content(user.name)
|
|
|
|
end
|
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
end
|