Reputation: 16441
I have done client side form validation using AngularJS, it works like a charm!
Then, I implemented server side validation and I want to test it by sending wrong data to the server. AngularJS (client side form validation) does not allow me to send wrong data to the server!
What can I do?
(Disabling Javascript cannot be a choice, because it will stop all ajax calls and thus no server side methods are called in my application)
Summery of the question:
users compromise front end validation (yes, it happens in practice!), how can I do the same for testing?
Upvotes: 1
Views: 721
Reputation: 14104
What you're asking doesn't make much sense. Angular does not prevent a request from being sent for any reason. If your form does that, it's only because you have coded it to do so. So, disabling validation in your case would be just a matter of commenting out the code that enforces it (that doesn't remain true if you're using custom validators. In that case, it may be a lot harder to disable validation altogether).
But, I wouldn't do that. In order to test your server-side validation, I suggest that you do one of the following:
Upvotes: 2