Added unit test for hook