I have a dashboard that has a lot of functionality, allows users to update various aspects of their account, check on status of various things, etc. This whole trend toward single page apps and all...
Anyway, because of that, the dashboard page is rife with JS that hides/ unhides various elements depending on what the user is doing, and my controllers are sending tons of flash messages to the page depending on what action user is doing and its success/ or errors.
Right now all of this is being tested via fully fledged feature tests which take forever...
Is there a unit-test framework for this? I've looked into a couple of JS unit test frameworks, but it seems like they are focused on testing functions and that functions are working, rather than the DOM elements. Specifically, to reiterate I need to test:
- Visibility (both on/off) of various DOM elements after various click actions and other things the user can do on the page
- Visibility of flash messages (this is probably a whole different animal than what I'm talking about here... basically in the controller specs I can test that the flash is being set by the controller, but since I can't follow a redirect in a controller spec, I can't test that the flash is being shown on the page appropriately--I guess to some extent this is testing overload, but I've definitely forgotten to put flash in the view before so...)
Aucun commentaire:
Enregistrer un commentaire