I’ve just started a new project with ember-cli, qunit and pretender.
There’s this one page which performs an initial ajax request, then based on the response it renders a few columns which will be filled with data from a second set of ajax requests.
So I have this initial spinner (loading substate) for the first request and then later multiple spinners, one for each column. After each request of the second set resolve, I’ll hide the corresponding spinners for each one and show the final content for each column.
I’d like to test the fact that there will be this initial spinner, it will disappear, then it will show columns with their own set of spinners, and finally they will all disappear when the final content in ready to be displayed.
I’ve been able to test the appearance of the first global spinner, since it’s part of the loading substate before any async task has completed. But I have problems tracking the subsequent columns spinners.
I’ve tried to use the andThen
helper, but it looks like it’s invoked right after all async behavior has resolved, which is when the columns are already filled in with data.
I’ve been trying to play with Ember.run loops in the app code and the tests without much success, but it could be possible that I just don’t have a good grasp of it.
Anyone has any idea on how I should approach this situation? Thanks!