2020-01-30 16:08:47 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'User sees user popover', :js do
|
2020-04-23 23:09:23 -04:00
|
|
|
include Spec::Support::Helpers::Features::NotesHelpers
|
|
|
|
|
2020-02-26 13:09:24 -05:00
|
|
|
let_it_be(:project) { create(:project, :repository) }
|
2020-01-30 16:08:47 -05:00
|
|
|
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-07-08 23:09:01 -04:00
|
|
|
let(:popover_selector) { '[data-testid="user-popover"]' }
|
2020-04-23 23:09:23 -04:00
|
|
|
|
2020-01-30 16:08:47 -05:00
|
|
|
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-04-23 23:09:23 -04:00
|
|
|
|
|
|
|
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-01-30 16:08:47 -05:00
|
|
|
end
|
|
|
|
end
|