Hi Keegan

I think I understand what you’re saying, but just to be clear:

> It seems the root of the issue is that dispatch is placing events into a
queue via an FSM implementation. This works well in production but it
causes all handlers that dispatch subsequent events to fail during tests,
as the events they dispatch will not be processed.

Why do you say that the events aren’t processed? Is it that they aren’t
processed at the time of evaluating the tests? dispatch-sync is indeed one
way of doing that. An alternative would be to write an async cljs test, and
call (done) in a callback from whichever is the final dispatch?

I know pupeno spent a bit of time on a similar sort of problem where he
wanted to render a re-frame app once all of the events had finished,
https://github.com/Day8/re-frame/pull/118.

On Thu, May 26, 2016 at 2:27 AM keegan myers <keeganmyers...@gmail.com>
wrote:

> I saw a closed issue on the re-frame repo related to this, but I could not
> find any follow up information. I've been working on an SPA for a client
> and am currently stuck trying to test the front-end. It seems the root of
> the issue is that dispatch is placing events into a queue via an FSM
> implementation. This works well in production but it causes all handlers
> that dispatch subsequent events to fail during tests, as the events they
> dispatch will not be processed. When I trigger the events manually in the
> tests via dispatch sync my tests perform as expected. However, this does
> not provide me with sufficient confidence in the codebase. I would prefer
> an implementation that allows me to use (sim/click (sel1 :#button-id) nil)
> and then evaluate app-db.
>
> In an ideal scenario I would like to test each component in isolation with
> react-test-utils simulation and jsdom however, I am willing to consider
> alternatives.
>
> --
> 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 clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.
>
-- 
—
Daniel

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to