diff options
Diffstat (limited to 'Example/Auth/Tests/FIRAuthTests.m')
-rw-r--r-- | Example/Auth/Tests/FIRAuthTests.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Example/Auth/Tests/FIRAuthTests.m b/Example/Auth/Tests/FIRAuthTests.m index 6a047a4..c008bab 100644 --- a/Example/Auth/Tests/FIRAuthTests.m +++ b/Example/Auth/Tests/FIRAuthTests.m @@ -18,7 +18,11 @@ #import <XCTest/XCTest.h> +#import <FirebaseAuth/FirebaseAuth.h> +#import <FirebaseAuthInterop/FIRAuthInterop.h> #import <FirebaseCore/FIRAppInternal.h> +#import <FirebaseCore/FIRComponent.h> +#import <FirebaseCore/FIRComponentRegistrant.h> #import "FIRAdditionalUserInfo.h" #import "FIRAuth_Internal.h" @@ -221,6 +225,10 @@ static const NSTimeInterval kExpectationTimeout = 2; */ static const NSTimeInterval kWaitInterval = .5; +/** Category for FIRAuth to expose FIRComponentRegistrant conformance. */ +@interface FIRAuth () <FIRComponentRegistrant> +@end + /** @class FIRAuthTests @brief Tests for @c FIRAuth. */ @@ -362,6 +370,8 @@ static const NSTimeInterval kWaitInterval = .5; @brief Verifies that FIRApp's getUIDImplementation is correctly set by FIRAuth. */ - (void)testGetUID { + // TODO: Remove this test once Firestore, Database, and Storage move over to the new Auth interop + // library. FIRApp *app = [FIRApp defaultApp]; XCTAssertNotNil(app.getUIDImplementation); [[FIRAuth auth] signOut:NULL]; @@ -2221,6 +2231,21 @@ static const NSTimeInterval kWaitInterval = .5; } #endif +#pragma mark - Interoperability Tests + +/** @fn testComponentsBeingRegistered + @brief Tests that Auth provides the necessary components for interoperability with other SDKs. + */ +- (void)testComponentsBeingRegistered { + // Verify that the components are registered properly. Check the count, because any time a new + // component is added it should be added to the test suite as well. + NSArray<FIRComponent *> *components = [FIRAuth componentsToRegister]; + XCTAssertTrue(components.count == 1); + + FIRComponent *component = [components firstObject]; + XCTAssert(component.protocol == @protocol(FIRAuthInterop)); +} + #pragma mark - Helpers /** @fn mockSecureTokenResponseWithError: |