@@ -20,7 +20,7 @@ jest.mock('@datadog/mobile-react-native', () => {
2020const flushPromises = ( ) =>
2121 new Promise ( jest . requireActual ( 'timers' ) . setImmediate ) ;
2222
23- const createCodepushPackageMock = label => ( {
23+ const createCodepushPackageMock = ( label : string | null ) => ( {
2424 label,
2525 isMandatory : false ,
2626 install : jest . fn ( ) ,
@@ -285,23 +285,28 @@ describe('AppCenter Codepush integration', () => {
285285 } = require ( '@datadog/mobile-react-native' ) ;
286286
287287 const autoInstrumentationConfig = {
288+ clientToken : 'fake-client-token' ,
289+ env : 'fake-env' ,
288290 rumConfiguration : {
291+ applicationId : 'fake-app-id' ,
292+ useAccessibilityLabel : true ,
289293 actionNameAttribute : 'test-action-name-attr' ,
290294 trackErrors : true ,
291295 trackResources : true ,
292- trackInteractions : true
296+ trackInteractions : true ,
297+ resourceTraceSampleRate : 100 ,
298+ nativeCrashReportEnabled : true ,
299+ nativeLongTaskThresholdMs : false ,
300+ nativeViewTracking : true ,
301+ firstPartyHosts : [
302+ {
303+ match : 'example.com' ,
304+ propagatorTypes : [ PropagatorType . DATADOG ]
305+ }
306+ ]
293307 } ,
294- firstPartyHosts : [
295- {
296- match : 'example.com' ,
297- propagatorTypes : [ PropagatorType . DATADOG ]
298- }
299- ] ,
300- useAccessibilityLabel : true ,
301308 logsConfiguration : { } ,
302- traceConfiguration : {
303- resourceTraceSampleRate : 100
304- }
309+ traceConfiguration : { }
305310 } ;
306311
307312 const configuration = new FileBasedConfiguration ( {
@@ -320,27 +325,28 @@ describe('AppCenter Codepush integration', () => {
320325 DdSdkReactNative . _enableFeaturesFromDatadogProvider
321326 ) . toHaveBeenCalledWith ( {
322327 rumConfiguration : {
328+ useAccessibilityLabel : true ,
323329 actionNameAttribute : 'test-action-name-attr' ,
324330 actionEventMapper : null ,
331+ nativeCrashReportEnabled : true ,
332+ nativeLongTaskThresholdMs : false ,
333+ nativeViewTracking : true ,
325334 resourceEventMapper : null ,
326335 errorEventMapper : null ,
327336 trackErrors : true ,
328337 trackResources : true ,
329- trackInteractions : true
338+ trackInteractions : true ,
339+ resourceTraceSampleRate : 100 ,
340+ firstPartyHosts : [
341+ {
342+ match : 'example.com' ,
343+ propagatorTypes : [ PropagatorType . DATADOG ]
344+ }
345+ ]
330346 } ,
331347 logsConfiguration : {
332348 logEventMapper : null
333- } ,
334- traceConfiguration : {
335- resourceTraceSampleRate : 100
336- } ,
337- firstPartyHosts : [
338- {
339- match : 'example.com' ,
340- propagatorTypes : [ PropagatorType . DATADOG ]
341- }
342- ] ,
343- useAccessibilityLabel : true
349+ }
344350 } ) ;
345351
346352 expect (
@@ -358,27 +364,14 @@ describe('AppCenter Codepush integration', () => {
358364 const { DatadogCodepushProvider } = require ( '..' ) ;
359365 const {
360366 DdSdkReactNative,
361- PropagatorType,
362367 FileBasedConfiguration
363368 } = require ( '@datadog/mobile-react-native' ) ;
364369
365370 const autoInstrumentationConfig = {
371+ clientToken : 'fake-client-token' ,
372+ env : 'fake-env' ,
366373 rumConfiguration : {
367- actionNameAttribute : 'test-action-name-attr' ,
368- trackErrors : true ,
369- trackResources : true ,
370- trackInteractions : true
371- } ,
372- logsConfiguration : { } ,
373- firstPartyHosts : [
374- {
375- match : 'example.com' ,
376- propagatorTypes : [ PropagatorType . DATADOG ]
377- }
378- ] ,
379- useAccessibilityLabel : true ,
380- traceConfiguration : {
381- resourceTraceSampleRate : 100
374+ applicationId : 'fake-app-id'
382375 }
383376 } ;
384377
@@ -396,30 +389,25 @@ describe('AppCenter Codepush integration', () => {
396389 } ) ;
397390 expect (
398391 DdSdkReactNative . _enableFeaturesFromDatadogProvider
399- ) . toHaveBeenCalledWith ( {
400- rumConfiguration : {
401- actionNameAttribute : 'test-action-name-attr' ,
402- trackErrors : true ,
403- trackResources : true ,
404- trackInteractions : true ,
405- actionEventMapper : null ,
406- resourceEventMapper : null ,
407- errorEventMapper : null
408- } ,
409- logsConfiguration : {
410- logEventMapper : null
411- } ,
412- firstPartyHosts : [
413- {
414- match : 'example.com' ,
415- propagatorTypes : [ PropagatorType . DATADOG ]
416- }
417- ] ,
418- traceConfiguration : {
419- resourceTraceSampleRate : 100
420- } ,
421- useAccessibilityLabel : true
422- } ) ;
392+ ) . toHaveBeenCalledWith (
393+ expect . objectContaining ( {
394+ rumConfiguration : expect . objectContaining ( {
395+ useAccessibilityLabel : true ,
396+ actionNameAttribute : undefined ,
397+ trackErrors : false ,
398+ trackResources : false ,
399+ trackInteractions : false ,
400+ actionEventMapper : null ,
401+ resourceEventMapper : null ,
402+ errorEventMapper : null ,
403+ resourceTraceSampleRate : 100 ,
404+ firstPartyHosts : [ ]
405+ } ) ,
406+ logsConfiguration : expect . objectContaining ( {
407+ logEventMapper : null
408+ } )
409+ } )
410+ ) ;
423411
424412 expect (
425413 DdSdkReactNative . _enableFeaturesFromDatadogProvider
0 commit comments