this expectation is inside of a callback - such expectations are not guaranteed to be executed so it's better to refactor this by exposing the spy outside of the closure and moving the expectation after the browserTrigger call on line 926