File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
tests/swift-sdk-swift-tests Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -702,6 +702,32 @@ class AuthTests: XCTestCase {
702
702
wait ( for: [ condition2] , timeout: 3 )
703
703
}
704
704
705
+ func testAuthTokenRequestingForAlreadyExistingEmail( ) {
706
+ let condition1 = expectation ( description: " auth handler didn't get called " )
707
+
708
+ let localStorage = MockLocalStorage ( )
709
+
710
+ localStorage. email = AuthTests . email
711
+
712
+ let config = IterableConfig ( )
713
+
714
+ let authDelegate = createAuthDelegate ( { handler in
715
+ condition1. fulfill ( )
716
+ } )
717
+
718
+ config. authDelegate = authDelegate
719
+
720
+ let internalAPI = IterableAPIInternal . initializeForTesting ( config: config,
721
+ localStorage: localStorage)
722
+
723
+ XCTAssertNotNil ( internalAPI. email)
724
+ XCTAssertNil ( internalAPI. authManager. getAuthToken ( ) )
725
+
726
+ internalAPI. email = AuthTests . email
727
+
728
+ wait ( for: [ condition1] , timeout: testExpectationTimeout)
729
+ }
730
+
705
731
// MARK: - Private
706
732
707
733
class DefaultAuthDelegate : IterableAuthDelegate {
You can’t perform that action at this time.
0 commit comments