I'm not sure if this code works or not, but it's fragile that you aren't returning a Promise from the callback to then().   I'd rather you wrote your code in a standard promise chain.

This comment applies throughout this test file.