Added test to verify that events trigger the appropriate listeners