Add unit test for events