The following posts will use QUnit functions for testing. There is no explicit marking of QUnit functoins. So, when in doubt search in QUnit API.
Testing if a button was clicked
test(“button clicked”, function(){As you can see the sky is the limit to what can be tested with such a technique.
$(“#button”).on(‘click’, function(event){
$(this).data(‘clicked’, true);
});
$(“#button”).click();
ok($(“#button”).data(‘clicked’), “button clicked”)
});
No comments:
Post a Comment