changed tests to work with promises