Added unit tests

Unit test covering promises handling