Fixed test to work with promises based functions