Add matcher for emoji
This commit is contained in:
parent
c39e3f22ce
commit
2bf3846adc
4 changed files with 10 additions and 5 deletions
|
@ -45,7 +45,7 @@ feature 'Admin Broadcast Messages' do
|
|||
|
||||
page.within('.broadcast-message-preview') do
|
||||
expect(page).to have_selector('strong', text: 'Markdown')
|
||||
expect(page).to have_selector('gl-emoji[data-name="tada"]')
|
||||
expect(page).to have_emoji('tada')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -98,7 +98,7 @@ feature 'Group show page' do
|
|||
|
||||
it 'shows the project info' do
|
||||
expect(page).to have_content(project.title)
|
||||
expect(page).to have_selector('gl-emoji[data-name="smile"]')
|
||||
expect(page).to have_emoji('smile')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -99,7 +99,7 @@ describe 'User interacts with awards in an issue', :js do
|
|||
click_button('Comment')
|
||||
end
|
||||
|
||||
expect(page).to have_selector('gl-emoji[data-name="smile"]')
|
||||
expect(page).to have_emoji('smile')
|
||||
end
|
||||
|
||||
context 'when a project is archived' do
|
||||
|
@ -118,7 +118,7 @@ describe 'User interacts with awards in an issue', :js do
|
|||
|
||||
it 'shows the award on the note' do
|
||||
page.within('.note-awards') do
|
||||
expect(page).to have_selector('gl-emoji[data-name="100"]')
|
||||
expect(page).to have_emoji('100')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -141,7 +141,7 @@ describe 'User interacts with awards in an issue', :js do
|
|||
wait_for_requests
|
||||
|
||||
page.within('.note-awards') do
|
||||
expect(page).to have_selector('gl-emoji[data-name="8ball"]')
|
||||
expect(page).to have_emoji('8ball')
|
||||
end
|
||||
expect(note.reload.award_emoji.size).to eq(2)
|
||||
end
|
||||
|
|
5
spec/support/matchers/have_emoji.rb
Normal file
5
spec/support/matchers/have_emoji.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
RSpec::Matchers.define :have_emoji do |emoji_name|
|
||||
match do |actual|
|
||||
expect(actual).to have_selector("gl-emoji[data-name='#{emoji_name}']")
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue