Is there a way to test confirm message?
I am trying to write a test for following method.
- $('#clickme').live('click', function() {
- if (confirm('Are you sure?')) {
- doSomething();
- }
- return false;
- });
I was wondering how to test confirm method. Is there a way to override confirm method.
If not then I was thinking of moving the confirm method to a different method and then I should mock that method to return true or false depending on test case.
Just want to know what others do in such cases to test a method.