aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorBrandon Aaron <brandon.aaron@gmail.com>2008-04-21 20:39:17 +0000
committerBrandon Aaron <brandon.aaron@gmail.com>2008-04-21 20:39:17 +0000
commit5d033dba02fc1ffe1398cdaf0e9d402fc75e13f0 (patch)
treed8969ef5d409145b8e13519304037c83f920767c /test/unit
parenta9fe9a2a5f935fc79610d952b68d592f5cfd9ff8 (diff)
downloadjquery-5d033dba02fc1ffe1398cdaf0e9d402fc75e13f0.tar.gz
jquery-5d033dba02fc1ffe1398cdaf0e9d402fc75e13f0.zip
Trigger onclick handlers of links
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/event.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index ba29ab7ec..0ec0f5966 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -113,7 +113,7 @@ test("bind(), namespaced events, cloned events", function() {
});
test("click()", function() {
- expect(4);
+ expect(5);
$('<li><a href="#">Change location</a></li>').prependTo('#firstUL').find('a').bind('click', function() {
var close = $('spanx', this); // same with $(this).find('span');
ok( close.length == 0, "Context element does not exist, length must be zero" );
@@ -131,6 +131,13 @@ test("click()", function() {
};
$('#firstp').click();
ok( counter == 1, "Check that click, triggers onclick event handler also" );
+
+ var clickCounter = 0;
+ $('#simon1')[0].onclick = function(event) {
+ clickCounter++;
+ };
+ $('#simon1').click();
+ ok( clickCounter == 1, "Check that click, triggers onclick event handler on an a tag also" );
});
test("unbind(event)", function() {