promise mocking fix + test