@@ -579,62 +579,63 @@ describe('rum assembly', () => {
579579 describe ( 'STREAM event processing' , ( ) => {
580580 it ( 'should convert STREAM events to VIEW events' , ( ) => {
581581 const { lifeCycle, serverRumEvents } = setupAssemblyTestWithDefaults ( { } )
582-
582+
583583 const streamData = {
584584 id : 'stream-id-123' ,
585585 document_version : 42 ,
586586 time_spent : 5000000000 , // 5 seconds in nanoseconds
587587 }
588-
588+
589589 notifyRawRumEvent ( lifeCycle , {
590- rawRumEvent : createRawRumEvent ( RumEventType . STREAM , {
590+ rawRumEvent : createRawRumEvent ( RumEventType . STREAM , {
591591 stream : streamData ,
592- view : { id : 'original-view-id' , url : '/test' }
592+ view : { id : 'original-view-id' , url : '/test' } ,
593593 } ) ,
594594 } )
595-
595+
596596 expect ( serverRumEvents . length ) . toBe ( 1 )
597597 const resultEvent = serverRumEvents [ 0 ]
598-
598+
599599 expect ( resultEvent . type ) . toBe ( 'view' )
600600 } )
601601
602602 it ( 'should map stream properties correctly in converted VIEW event' , ( ) => {
603603 const { lifeCycle, serverRumEvents } = setupAssemblyTestWithDefaults ( { } )
604-
604+
605605 const streamData = {
606606 id : 'stream-id-456' ,
607607 document_version : 25 ,
608608 time_spent : 3000000000 , // 3 seconds in nanoseconds
609609 }
610-
610+
611611 notifyRawRumEvent ( lifeCycle , {
612- rawRumEvent : createRawRumEvent ( RumEventType . STREAM , {
612+ rawRumEvent : createRawRumEvent ( RumEventType . STREAM , {
613613 stream : streamData ,
614- view : { id : 'original-view-id' , url : '/test-page' }
614+ view : { id : 'original-view-id' , url : '/test-page' } ,
615615 } ) ,
616616 } )
617-
617+
618618 expect ( serverRumEvents . length ) . toBe ( 1 )
619619 const resultEvent = serverRumEvents [ 0 ] as any
620-
620+
621621 // Check _dd.document_version is set from stream.document_version
622622 expect ( resultEvent . _dd . document_version ) . toBe ( 25 )
623-
623+
624624 // Check view.id is set from stream.id
625625 expect ( resultEvent . view . id ) . toBe ( 'stream-id-456' )
626-
626+
627627 // Check view.time_spent is set from stream.time_spent
628628 expect ( resultEvent . view . time_spent ) . toBe ( 3000000000 )
629-
629+
630630 // Check stream.time_spent is undefined in the stream object
631631 expect ( resultEvent . stream . time_spent ) . toBeUndefined ( )
632-
632+
633633 // Check action/error/resource counts are set to 0
634634 expect ( resultEvent . view . action . count ) . toBe ( 0 )
635635 expect ( resultEvent . view . error . count ) . toBe ( 0 )
636636 expect ( resultEvent . view . resource . count ) . toBe ( 0 )
637637 } )
638+ } )
638639} )
639640
640641function notifyRawRumEvent < E extends RawRumEvent > (
0 commit comments