Added unit test javascript code