Skip to main content

Search and Top Navigation

Ticket #5148: ui-button-click-option-test.patch


File ui-button-click-option-test.patch, 0.7 KB (added by vmx, February 08, 2010 01:10AM UTC)

Test case for binding an click event to a ui.button

Index: tests/unit/button/button_events.js
===================================================================
--- tests/unit/button/button_events.js	(revision 3788)
+++ tests/unit/button/button_events.js	(working copy)
@@ -14,4 +14,22 @@
 	ok( set.find("label:first").click().is(".ui-button") );
 });
 
+test("click (set with bind)", function() {
+	expect(2);
+	$("#button").button().bind("click", function() {
+		ok( true );
+	});
+	ok( $("#button").click().is(".ui-button"), "Click event should have been fired" );
+});
+
+test("click (set as option)", function() {
+	expect(2);
+	$("#button").button({
+		click: function() {
+			ok( true );
+		}
+	});
+	ok( $("#button").click().is(".ui-button"),  "Click event should have been fired" );
+});
+
 })(jQuery);

Download in other formats:

Original Format