Trying to test promises and failing