Assuming an entirely app-state-driven UI (i.e. UI simply reacts to changes
in app state and is never controlled directly by the application logic) ,

Has anyone tried to test their app by testing against an input/output spec
that maps each UI event to a set of changes in the app-state atom, and
running assertions on that?

With JS, we can overwrite addEventListener before it's used by the app and
this way we'll know when any UI event is triggered, without having to
inject any debugging code into the handlers.  All I would have to do is to
have a map that links each UI event on a given element (or the window
object) to a set of mutations in the atom and then assert that the expected
mutations have happened.

This would catch many errors stemming from failure to update state
correctly in response to UI events.

Is there a formal approach around this? and is it a good idea in the first
place?

Thanks in advance

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to