- $("#firstp").bind("click", {foo: "bar"}, handler).trigger("click", [{bar: "foo"}]).unbind(handler);
-
- reset();
+ $("#firstp").bind("click", {foo: "bar"}, handler).trigger("click", [{bar: "foo"}]).unbind("click", handler);
+});
+
+test("bind(), multiple events at once", function() {
+ expect(2);
+ var clickCounter = 0,
+ mouseoverCounter = 0;
+ var handler = function(event) {
+ if (event.type == "click")
+ clickCounter += 1;
+ else if (event.type == "mouseover")
+ mouseoverCounter += 1;
+ };
+ $("#firstp").bind("click mouseover", handler).trigger("click").trigger("mouseover");
+ ok( clickCounter == 1, "bind() with multiple events at once" );
+ ok( mouseoverCounter == 1, "bind() with multiple events at once" );
+});
+
+test("bind(), no data", function() {
+ expect(1);