devxoul/Toaster

[2.0.4] cancelAll() doesn't cancel toasts immediately

ldiqual opened this issue · 1 comments

We're running a bunch of unit tests which ensure that toasts show with a specific message. After ensuring that the toast shows, we cancel all toasts so that the next test doesn't mess with a previously shown toast. It looks like this:

vc.submitButton.sendActions(for: .touchUpInside) // Triggers `Toast(text: "hello").show()`
expect(ToastCenter.default.currentToast.text).to(equal("hello"))
ToastCenter.default.cancelAll()
expect(ToastCenter.default.currentToast).to(beNil())

With 2.0.3, the assertions above run smoothly. With 2.0.4, ToastCenter.default.currentToast is not nil. Here's the diff: 2.0.3...2.0.4#diff-da60668d6e40aed0148429ffdc135caeR166. Not too sure what changed :/

I should have written tests :'( I'll check this soon. Thanks for reporting!