Add tests for spyOnEvent