Skip to content
Snippets Groups Projects

Enable the improved emoji picker by default

Merged Phil Hughes requested to merge ph/enableImprovedEmojiPicker into master
@@ -51,29 +51,24 @@
it 'toggles a custom award emoji' do
page.within('.awards') do
page.find('.js-add-award').click
page.find('.add-reaction-button').click
end
page.find('.emoji-menu.is-visible')
expect(page).to have_selector('.js-emoji-menu-search')
expect(page.evaluate_script("document.activeElement.classList.contains('js-emoji-menu-search')")).to eq(true)
page.within('.emoji-menu-content') do
emoji_button = page.first('.js-emoji-btn')
page.within('.emoji-picker') do
emoji_button = page.first('gl-emoji[data-name="8ball"]')
emoji_button.hover
emoji_button.click
end
page.within('.awards') do
expect(page).to have_selector('.js-emoji-btn')
expect(page.find('.js-emoji-btn.active .js-counter')).to have_content('1')
expect(page).to have_css(".js-emoji-btn.active[title='You']")
expect(page).to have_selector('[data-testid="award-button"]')
expect(page.find('[data-testid="award-button"].is-active .js-counter')).to have_content('1')
expect(page).to have_css('[data-testid="award-button"].is-active[title="You"]')
expect do
page.find('.js-emoji-btn.active').click
page.find('[data-testid="award-button"].is-active').click
wait_for_requests
end.to change { page.all('.award-control.js-emoji-btn').size }.from(3).to(2)
end.to change { page.all('[data-testid="award-button"]').size }.from(3).to(2)
end
end
@@ -208,31 +203,25 @@
end
it 'adds award to issue' do
first('.js-emoji-btn').click
first('[data-testid="award-button"]').click
expect(page).to have_selector('.js-emoji-btn.active')
expect(first('.js-emoji-btn')).to have_content '1'
expect(page).to have_selector('[data-testid="award-button"].is-active')
expect(first('[data-testid="award-button"]')).to have_content '1'
visit project_issue_path(project, issue)
expect(first('.js-emoji-btn')).to have_content '1'
expect(first('[data-testid="award-button"]')).to have_content '1'
end
it 'removes award from issue' do
first('.js-emoji-btn').click
find('.js-emoji-btn.active').click
first('[data-testid="award-button"]').click
find('[data-testid="award-button"].is-active').click
expect(first('.js-emoji-btn')).to have_content '0'
expect(first('[data-testid="award-button"]')).to have_content '0'
visit project_issue_path(project, issue)
expect(first('.js-emoji-btn')).to have_content '0'
end
it 'only has one menu on the page' do
first('.js-add-award').click
expect(page).to have_selector('.emoji-menu', count: 1)
expect(first('[data-testid="award-button"]')).to have_content '0'
end
end
@@ -326,7 +315,7 @@
end
it 'has disabled emoji button' do
expect(first('.award-control')[:class]).to have_text('disabled')
expect(first('[data-testid="award-button"]')[:class]).to have_text('disabled')
end
end
@@ -352,7 +341,7 @@ def emoji_counter
end
def noteable_award_counter
".awards .active"
".awards .is-active"
end
def toggle_smiley_emoji(status)
Loading