@@ -122,6 +122,86 @@ - (void)testCreateOptionsWithDictionaryAutoPerformanceTracingDisabled
122
122
XCTAssertEqual (actualOptions.enableAutoPerformanceTracing , false , @" Did not disable Auto Performance Tracing" );
123
123
}
124
124
125
+ - (void )testCreateOptionsWithDictionarySpotlightEnabled
126
+ {
127
+ RNSentry * rnSentry = [[RNSentry alloc ] init ];
128
+ NSError * error = nil ;
129
+
130
+ NSDictionary *_Nonnull mockedReactNativeDictionary = @{
131
+ @" dsn" :
@" https://[email protected] /123456" ,
132
+ @" spotlight" : @YES ,
133
+ @" defaultSidecarUrl" : @" http://localhost:8969/teststream" ,
134
+ };
135
+ SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary: mockedReactNativeDictionary error: &error];
136
+ XCTAssertNotNil (actualOptions, @" Did not create sentry options" );
137
+ XCTAssertNil (error, @" Should not pass no error" );
138
+ XCTAssertTrue (actualOptions.enableSpotlight , @" Did not enable spotlight" );
139
+ XCTAssertEqual (actualOptions.spotlightUrl , @" http://localhost:8969/teststream" );
140
+ }
141
+
142
+ - (void )testCreateOptionsWithDictionarySpotlightOne
143
+ {
144
+ RNSentry * rnSentry = [[RNSentry alloc ] init ];
145
+ NSError * error = nil ;
146
+
147
+ NSDictionary *_Nonnull mockedReactNativeDictionary = @{
148
+ @" dsn" :
@" https://[email protected] /123456" ,
149
+ @" spotlight" : @1 ,
150
+ @" defaultSidecarUrl" : @" http://localhost:8969/teststream" ,
151
+ };
152
+ SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary: mockedReactNativeDictionary error: &error];
153
+ XCTAssertNotNil (actualOptions, @" Did not create sentry options" );
154
+ XCTAssertNil (error, @" Should not pass no error" );
155
+ XCTAssertTrue (actualOptions.enableSpotlight , @" Did not enable spotlight" );
156
+ XCTAssertEqual (actualOptions.spotlightUrl , @" http://localhost:8969/teststream" );
157
+ }
158
+
159
+ - (void )testCreateOptionsWithDictionarySpotlightUrl
160
+ {
161
+ RNSentry * rnSentry = [[RNSentry alloc ] init ];
162
+ NSError * error = nil ;
163
+
164
+ NSDictionary *_Nonnull mockedReactNativeDictionary = @{
165
+ @" dsn" :
@" https://[email protected] /123456" ,
166
+ @" spotlight" : @" http://localhost:8969/teststream" ,
167
+ };
168
+ SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary: mockedReactNativeDictionary error: &error];
169
+ XCTAssertNotNil (actualOptions, @" Did not create sentry options" );
170
+ XCTAssertNil (error, @" Should not pass no error" );
171
+ XCTAssertTrue (actualOptions.enableSpotlight , @" Did not enable spotlight" );
172
+ XCTAssertEqual (actualOptions.spotlightUrl , @" http://localhost:8969/teststream" );
173
+ }
174
+
175
+ - (void )testCreateOptionsWithDictionarySpotlightDisabled
176
+ {
177
+ RNSentry * rnSentry = [[RNSentry alloc ] init ];
178
+ NSError * error = nil ;
179
+
180
+ NSDictionary *_Nonnull mockedReactNativeDictionary = @{
181
+ @" dsn" :
@" https://[email protected] /123456" ,
182
+ @" spotlight" : @NO ,
183
+ };
184
+ SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary: mockedReactNativeDictionary error: &error];
185
+ XCTAssertNotNil (actualOptions, @" Did not create sentry options" );
186
+ XCTAssertNil (error, @" Should not pass no error" );
187
+ XCTAssertFalse (actualOptions.enableSpotlight , @" Did not disable spotlight" );
188
+ }
189
+
190
+ - (void )testCreateOptionsWithDictionarySpotlightZero
191
+ {
192
+ RNSentry * rnSentry = [[RNSentry alloc ] init ];
193
+ NSError * error = nil ;
194
+
195
+ NSDictionary *_Nonnull mockedReactNativeDictionary = @{
196
+ @" dsn" :
@" https://[email protected] /123456" ,
197
+ @" spotlight" : @0 ,
198
+ };
199
+ SentryOptions* actualOptions = [rnSentry createOptionsWithDictionary: mockedReactNativeDictionary error: &error];
200
+ XCTAssertNotNil (actualOptions, @" Did not create sentry options" );
201
+ XCTAssertNil (error, @" Should not pass no error" );
202
+ XCTAssertFalse (actualOptions.enableSpotlight , @" Did not disable spotlight" );
203
+ }
204
+
125
205
- (void )testPassesErrorOnWrongDsn
126
206
{
127
207
RNSentry * rnSentry = [[RNSentry alloc ] init ];
0 commit comments