I am trying to setup an integration test here but I don’t manage to use triggerEvent before the run.later from this method.
I tried to play around with the run loop but didn’t find how to handle this correctly. I had thought at first that with the running loop being manually managed in the tests calling triggerEvent right after visit would propagate the event directly and that calling andThen after would let the promises complete and make my test pass
btw: the feature I’m trying to implement seems to be working in the dummy application.
What you might need is a helper that would pause destroying of a flash object until you tell it to. Something like pauseFlashMessages() and continueFlashMessages(). You’d need to try it out and see what feels more natural.
It would make a good extension, in the same way that simple-auth provides and extension for testing called simple-auth-testing
@tarasm then I should probably reopen the flash object class to change the how the destroyTimer is handled.
It might not be as simple as using pause/continueFlashMessages() though because what the flash object does when it’s component get mouseovered (on mouseenter) is to cancel the timeout. So I cannot just pause, trigger and then continue else it will kill the timer twice (well why not?) and then put it back (which I need to avoid if it’s mouseovered.
Reopening the flash object class and setting a property to true/false instead of setting/removing the timer should be fine in coordination with the pause/continueFlashMessages()
Thanks to both of you for your help! It’s nice to see that the community is so alive.