Updated unit tests to use waitsForPromise where appropriate.