refactor promise tests