sinon based event testing for sonar and switch