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

File ui-button-click-option-test.patch, 761 bytes (added by vmx, 12 years ago)

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

  • tests/unit/button/button_events.js

     
    1414        ok( set.find("label:first").click().is(".ui-button") );
    1515});
    1616
     17test("click (set with bind)", function() {
     18        expect(2);
     19        $("#button").button().bind("click", function() {
     20                ok( true );
     21        });
     22        ok( $("#button").click().is(".ui-button"), "Click event should have been fired" );
     23});
     24
     25test("click (set as option)", function() {
     26        expect(2);
     27        $("#button").button({
     28                click: function() {
     29                        ok( true );
     30                }
     31        });
     32        ok( $("#button").click().is(".ui-button"),  "Click event should have been fired" );
     33});
     34
    1735})(jQuery);