migrating tests to promise chain