Cinder Table and Testing
Thank you for Cinder. Very nice.
I have some basic LiveView tests and they are now breaking with Cinder. I believe it is b/c the Table makes the query and the assert is happening before the data is loaded. What is the right fix for this in tests? I can add a timeout but that feels dirty.
This test fails with Cinder.
7 Replies
@sevenseacat would be the one to say, but perhaps Cinder should look for Ash's
disable_async?
config and if set it should fetch results on page load and not do loading states? Or maybe have your own config for that to allow testing loading states etc.internally we use
render_async
when testing, to wait for async data loading to happen before we run assertionsoh interesting.
Cool, didn't realize that was a thing ๐
(but makes perfect sense to exist in retrospect ๐
I didn't either. Nice.
This works. Thanks.
I looked in the docs for testing notes, but didn't find anything. This might be a nice little testing tip to add.
PR/issue would be great there ๐
will do it.
GitHub
Add docs for testing with render_async by forest ยท Pull Request #4...
Cinder uses assign_async to load data, so LiveView tests need to use render_async to wait for the data to load.