Commit b80df087 authored by Annabel Dunstone's avatar Annabel Dunstone

Add timeout for ajax call in award emoji steps; update focus in award picker

parent 074fa8f2
......@@ -5,7 +5,6 @@ class @AwardsHandler
event.preventDefault()
@showEmojiMenu()
$("#emoji_search").focus()
$("html").on 'click', (event) ->
if !$(event.target).closest(".emoji-menu").length
......@@ -18,10 +17,12 @@ class @AwardsHandler
showEmojiMenu: ->
if $(".emoji-menu").length
$(".emoji-menu").show()
$("#emoji_search").focus()
else
$.get "/emoji_menu", (response) ->
$(".add-award").after response
$(".emoji-menu").show()
$("#emoji_search").focus()
addAward: (emoji) ->
emoji = @normilizeEmojiName(emoji)
......
......@@ -96,6 +96,7 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
end
step 'The search field is focused' do
sleep 0.8
page.evaluate_script("document.activeElement.id").should eq "emoji_search"
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