-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Spotlight in Android and iOS SDKs (#4211)
* Passes spotlight initialisation option to the native SDKs * Adds changelog * Extracts getSentryAndroidOptions method and adds test * Handles spotlight url parameters in cocoa * Handles spotlight url parameters in java * Pass the RN JS defaultSidecarUrl to the platform layers when Spotlight is enabled --------- Co-authored-by: LucasZF <[email protected]>
- Loading branch information
1 parent
1faf8e3
commit 9cab16b
Showing
9 changed files
with
296 additions
and
126 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
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 |
---|---|---|
|
@@ -122,6 +122,86 @@ - (void)testCreateOptionsWithDictionaryAutoPerformanceTracingDisabled | |
XCTAssertEqual(actualOptions.enableAutoPerformanceTracing, false, @"Did not disable Auto Performance Tracing"); | ||
} | ||
|
||
- (void)testCreateOptionsWithDictionarySpotlightEnabled | ||
{ | ||
RNSentry * rnSentry = [[RNSentry alloc] init]; | ||
NSError* error = nil; | ||
|
||
NSDictionary *_Nonnull mockedReactNativeDictionary = @{ | ||
@"dsn": @"https://[email protected]/123456", | ||
@"spotlight": @YES, | ||
@"defaultSidecarUrl": @"http://localhost:8969/teststream", | ||
}; | ||
SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; | ||
XCTAssertNotNil(actualOptions, @"Did not create sentry options"); | ||
XCTAssertNil(error, @"Should not pass no error"); | ||
XCTAssertTrue(actualOptions.enableSpotlight , @"Did not enable spotlight"); | ||
XCTAssertEqual(actualOptions.spotlightUrl , @"http://localhost:8969/teststream"); | ||
} | ||
|
||
- (void)testCreateOptionsWithDictionarySpotlightOne | ||
{ | ||
RNSentry * rnSentry = [[RNSentry alloc] init]; | ||
NSError* error = nil; | ||
|
||
NSDictionary *_Nonnull mockedReactNativeDictionary = @{ | ||
@"dsn": @"https://[email protected]/123456", | ||
@"spotlight": @1, | ||
@"defaultSidecarUrl": @"http://localhost:8969/teststream", | ||
}; | ||
SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; | ||
XCTAssertNotNil(actualOptions, @"Did not create sentry options"); | ||
XCTAssertNil(error, @"Should not pass no error"); | ||
XCTAssertTrue(actualOptions.enableSpotlight , @"Did not enable spotlight"); | ||
XCTAssertEqual(actualOptions.spotlightUrl , @"http://localhost:8969/teststream"); | ||
} | ||
|
||
- (void)testCreateOptionsWithDictionarySpotlightUrl | ||
{ | ||
RNSentry * rnSentry = [[RNSentry alloc] init]; | ||
NSError* error = nil; | ||
|
||
NSDictionary *_Nonnull mockedReactNativeDictionary = @{ | ||
@"dsn": @"https://[email protected]/123456", | ||
@"spotlight": @"http://localhost:8969/teststream", | ||
}; | ||
SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; | ||
XCTAssertNotNil(actualOptions, @"Did not create sentry options"); | ||
XCTAssertNil(error, @"Should not pass no error"); | ||
XCTAssertTrue(actualOptions.enableSpotlight , @"Did not enable spotlight"); | ||
XCTAssertEqual(actualOptions.spotlightUrl , @"http://localhost:8969/teststream"); | ||
} | ||
|
||
- (void)testCreateOptionsWithDictionarySpotlightDisabled | ||
{ | ||
RNSentry * rnSentry = [[RNSentry alloc] init]; | ||
NSError* error = nil; | ||
|
||
NSDictionary *_Nonnull mockedReactNativeDictionary = @{ | ||
@"dsn": @"https://[email protected]/123456", | ||
@"spotlight": @NO, | ||
}; | ||
SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; | ||
XCTAssertNotNil(actualOptions, @"Did not create sentry options"); | ||
XCTAssertNil(error, @"Should not pass no error"); | ||
XCTAssertFalse(actualOptions.enableSpotlight, @"Did not disable spotlight"); | ||
} | ||
|
||
- (void)testCreateOptionsWithDictionarySpotlightZero | ||
{ | ||
RNSentry * rnSentry = [[RNSentry alloc] init]; | ||
NSError* error = nil; | ||
|
||
NSDictionary *_Nonnull mockedReactNativeDictionary = @{ | ||
@"dsn": @"https://[email protected]/123456", | ||
@"spotlight": @0, | ||
}; | ||
SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary error:&error]; | ||
XCTAssertNotNil(actualOptions, @"Did not create sentry options"); | ||
XCTAssertNil(error, @"Should not pass no error"); | ||
XCTAssertFalse(actualOptions.enableSpotlight, @"Did not disable spotlight"); | ||
} | ||
|
||
- (void)testPassesErrorOnWrongDsn | ||
{ | ||
RNSentry * rnSentry = [[RNSentry alloc] init]; | ||
|
Oops, something went wrong.