Test that events are emitted