librelist archives

« back to archive

Unit tests and client-side JavaScript

Unit tests and client-side JavaScript

From:
Max Countryman
Date:
2011-12-05 @ 12:50
Hi All,

I'm struggling with unit testing a couple of views that make use of the 
Stripe payments API. These views require that some JS be executed in order
to function. As far as I can tell, during testing, JavaScript isn't 
actually executed. Instead the view returns a 400 Bad Request error.

What's the best way to handle this? Is there a way to validate that 
client-side JS is indeed doing what I expect within the unit tests itself?
The view won't function without the Stripe token and it makes it difficult
to test the other views if I can't find a workaround for this particular 
problem.

Thanks,


Max