Fixed jquery event listener from notifications-badge.js

This commit is contained in:
Hincu Petru 2014-03-17 18:41:15 +00:00
parent 3a91061d4f
commit b43e56485d
3 changed files with 23 additions and 5 deletions

View file

@ -24,12 +24,10 @@
});
}
self.dropdown.click(function(evt) {
evt.stopPropagation();
});
self.documentBody.click(function(evt) {
if(self.dropdownShowing()) {
var inDropdown = $(evt.target).parents().is(self.dropdown);
if(!inDropdown && self.dropdownShowing()) {
self.badgeLink.click();
}
});

View file

@ -86,3 +86,14 @@ Feature: Notifications
Then I should not see "mentioned you in the post"
When I filter notifications by mentions
Then I should see "mentioned you in the post"
Scenario: show aspect dropdown in user hovercard
When I sign in as "bob@bob.bob"
And I am on "alice@alice.alice"'s page
And I add the person to my "Besties" aspect
And I sign out
When I sign in as "alice@alice.alice"
And I follow "Notifications" in the header
And I active the first hovercard after loading the notifications page
When I press the aspect dropdown
Then the aspect dropdown should be visible

View file

@ -68,6 +68,10 @@ When /^I press the aspect dropdown$/ do
find('.dropdown .button').click
end
Then /^the aspect dropdown should be visible$/ do
find(:css, '.aspect_membership.dropdown.active').should be_visible
end
And /^I toggle the aspect "([^"]*)"$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first
find(".dropdown li[data-aspect_id='#{aspect.id}']").click
@ -281,3 +285,8 @@ end
Then(/^I should have a validation error on "(.*?)"$/) do |field_list|
check_fields_validation_error field_list
end
And /^I active the first hovercard after loading the notifications page$/ do
page.should have_css '.notifications .hovercardable'
first('.notifications .hovercardable').hover
end