Add unit test for listener