Commit ac7713f5 authored by peterhegman's avatar peterhegman

Add test to ensure status emojis are rendered

This test needs to run in a headless browser so it has only been added
to the issues spec so it doesn't unnecessarily slow down the test suite
parent eeac5946
......@@ -35,18 +35,38 @@ describe "User views issue" do
describe 'user status' do
subject { visit(project_issue_path(project, issue)) }
describe 'showing status of the author of the issue' do
context 'showing status of the author of the issue' do
it_behaves_like 'showing user status' do
let(:user_with_status) { issue.author }
end
end
describe 'showing status of a user who commented on an issue', :js do
context 'showing status of a user who commented on an issue', :js do
let!(:note) { create(:note, noteable: issue, project: project, author: user_with_status) }
it_behaves_like 'showing user status' do
let(:user_with_status) { create(:user) }
end
end
context 'when status message has an emoji', :js do
message = 'My status with an emoji'
message_emoji = 'basketball'
let!(:note) { create(:note, noteable: issue, project: project, author: user) }
let!(:status) { create(:user_status, user: user, emoji: 'smirk', message: "#{message} :#{message_emoji}:") }
it 'correctly renders the emoji' do
tooltip_span = page.first(".user-status-emoji[title^='#{message}']")
tooltip_span.hover
tooltip = page.find('.tooltip .tooltip-inner')
page.within(tooltip) do
expect(page).to have_emoji(message_emoji)
end
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment