mardi 28 avril 2015

How to test data-dependent javascript

Lets say I have Visual Studio, angular js project, mvc controller (data feed). Using this I have created a simple page where I have text filter (textbox) and an additional checkbox condition. When I input some text and/or (un)check the checkbox then a call goes to the controller (basically a rest address) and the result of this request (json data) populates a list or results (binded using angularjs).

So using jasmin (but this could be anything else, really) I want to have, a test that will tell me that the filtering really does something (is made use of) and that the data is rebound on text-change etc.

But wait up. I want to know that both conditions are met but I don't really want to work on the real data because nor I want to test the real controller as it is a job for server-side unit tests.

What should I do?

Aucun commentaire:

Enregistrer un commentaire