Fork me on GitHub
#fulcro
<
2023-06-08
>
sihingkk22:06:53

Hi, I have a component calling (df/load! …) inside :will-enter / route-deferred I’m trying to test it with (app/headless-synchronous-app Root settings) - it works great, but I can’t force it to wait until load! finish. I would like to have headless end-to-end test - any suggestions how to approach it?

Jakub Holý (HolyJak)21:06:44

Without digging into the code, I would wildly quess that the load! might be indeed synchronous but that dynamic routing and route-deferred are by nature async. Not sure whether this is true, and if so, how to make route-deferred behave synchronosuly.

Jakub Holý (HolyJak)21:06:04

You can see here https://github.com/fulcrologic/fulcro/blob/main/src/main/com/fulcrologic/fulcro/routing/dynamic_routing.cljc#L755-L756 (if I found the correct piece of code) that the deferred transaction is instructed to run after render. I don’t know how to make it run immediately …

sihingkk08:06:37

Thanks Jakub. the same problem is with load! - do you know how to force to make it syncronisly or use it in integration tests?

🤷 2
Jakub Holý (HolyJak)10:06:53

Is it, though? My memory is not clear now but my impression was that headless-synchronous-app made it synchronous…