-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed callback issue with set email after logout
- Loading branch information
Showing
2 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -972,6 +972,7 @@ public void shouldFireOnSuccessOfEmailUpdate() throws Exception { | |
OneSignalInit(); | ||
TestEmailUpdateHandler testEmailUpdateHandler = new TestEmailUpdateHandler(); | ||
OneSignal.setEmail("[email protected]", testEmailUpdateHandler); | ||
Assert.assertFalse(testEmailUpdateHandler.emailFiredSuccess); | ||
threadAndTaskWait(); | ||
|
||
Assert.assertTrue(testEmailUpdateHandler.emailFiredSuccess); | ||
|
@@ -1005,6 +1006,19 @@ public void shouldFireOnFailureOfEmailUpdateOnNetworkFailure() throws Exception | |
Assert.assertEquals(OneSignal.EmailErrorType.NETWORK, testEmailUpdateHandler.emailFiredFailure.getType()); | ||
} | ||
|
||
@Test | ||
public void shouldFireOnSuccessOnlyAfterNetworkCallAfterLogout() throws Exception { | ||
OneSignalInit(); | ||
emailSetThenLogout(); | ||
TestEmailUpdateHandler testEmailUpdateHandler = new TestEmailUpdateHandler(); | ||
OneSignal.setEmail("[email protected]", testEmailUpdateHandler); | ||
Assert.assertFalse(testEmailUpdateHandler.emailFiredSuccess); | ||
threadAndTaskWait(); | ||
|
||
Assert.assertTrue(testEmailUpdateHandler.emailFiredSuccess); | ||
Assert.assertNull(testEmailUpdateHandler.emailFiredFailure); | ||
} | ||
|
||
// Should create a new email instead of updating existing player record when no auth hash | ||
@Test | ||
public void shouldDoPostOnEmailChange() throws Exception { | ||
|