unit tests of promise and ajax