Changes test to use a then promise rather than a callback