@@ -14,11 +14,11 @@ function d(ms: number) {
1414}
1515
1616describe ( "session-replay-streams" , ( ) => {
17- it ( "treats null tabId as its own stream" , ( ) => {
17+ it ( "treats null sessionReplaySegmentId as its own stream" , ( ) => {
1818 const streams = groupChunksIntoTabStreams ( [
19- { tabId : null , firstEventAt : d ( 10 ) , lastEventAt : d ( 20 ) , eventCount : 2 } ,
20- { tabId : null , firstEventAt : d ( 21 ) , lastEventAt : d ( 30 ) , eventCount : 1 } ,
21- { tabId : "a" , firstEventAt : d ( 5 ) , lastEventAt : d ( 25 ) , eventCount : 10 } ,
19+ { sessionReplaySegmentId : null , firstEventAt : d ( 10 ) , lastEventAt : d ( 20 ) , eventCount : 2 } ,
20+ { sessionReplaySegmentId : null , firstEventAt : d ( 21 ) , lastEventAt : d ( 30 ) , eventCount : 1 } ,
21+ { sessionReplaySegmentId : "a" , firstEventAt : d ( 5 ) , lastEventAt : d ( 25 ) , eventCount : 10 } ,
2222 ] ) ;
2323
2424 expect ( streams . map ( s => s . tabKey ) . sort ( ) ) . toEqual ( [ NULL_TAB_KEY , "a" ] . sort ( ) ) ;
@@ -27,19 +27,19 @@ describe("session-replay-streams", () => {
2727
2828 it ( "sorts streams by lastEventAt desc then eventCount desc" , ( ) => {
2929 const streams = groupChunksIntoTabStreams ( [
30- { tabId : "a" , firstEventAt : d ( 0 ) , lastEventAt : d ( 10 ) , eventCount : 5 } ,
31- { tabId : "b" , firstEventAt : d ( 0 ) , lastEventAt : d ( 20 ) , eventCount : 1 } ,
32- { tabId : "c" , firstEventAt : d ( 0 ) , lastEventAt : d ( 20 ) , eventCount : 9 } ,
30+ { sessionReplaySegmentId : "a" , firstEventAt : d ( 0 ) , lastEventAt : d ( 10 ) , eventCount : 5 } ,
31+ { sessionReplaySegmentId : "b" , firstEventAt : d ( 0 ) , lastEventAt : d ( 20 ) , eventCount : 1 } ,
32+ { sessionReplaySegmentId : "c" , firstEventAt : d ( 0 ) , lastEventAt : d ( 20 ) , eventCount : 9 } ,
3333 ] ) ;
3434
35- expect ( streams . map ( s => s . tabId ) ) . toEqual ( [ "c" , "b" , "a" ] ) ;
35+ expect ( streams . map ( s => s . sessionReplaySegmentId ) ) . toEqual ( [ "c" , "b" , "a" ] ) ;
3636 } ) ;
3737
3838 it ( "limits streams and reports hiddenCount" , ( ) => {
3939 const streams = groupChunksIntoTabStreams ( [
40- { tabId : "a" , firstEventAt : d ( 0 ) , lastEventAt : d ( 10 ) , eventCount : 1 } ,
41- { tabId : "b" , firstEventAt : d ( 0 ) , lastEventAt : d ( 20 ) , eventCount : 1 } ,
42- { tabId : "c" , firstEventAt : d ( 0 ) , lastEventAt : d ( 30 ) , eventCount : 1 } ,
40+ { sessionReplaySegmentId : "a" , firstEventAt : d ( 0 ) , lastEventAt : d ( 10 ) , eventCount : 1 } ,
41+ { sessionReplaySegmentId : "b" , firstEventAt : d ( 0 ) , lastEventAt : d ( 20 ) , eventCount : 1 } ,
42+ { sessionReplaySegmentId : "c" , firstEventAt : d ( 0 ) , lastEventAt : d ( 30 ) , eventCount : 1 } ,
4343 ] ) ;
4444
4545 const limited = limitTabStreams ( streams , 2 ) ;
@@ -49,8 +49,8 @@ describe("session-replay-streams", () => {
4949
5050 it ( "maps global offsets to local offsets and back" , ( ) => {
5151 const streams = groupChunksIntoTabStreams ( [
52- { tabId : "a" , firstEventAt : d ( 1000 ) , lastEventAt : d ( 5000 ) , eventCount : 1 } ,
53- { tabId : "b" , firstEventAt : d ( 2000 ) , lastEventAt : d ( 4000 ) , eventCount : 1 } ,
52+ { sessionReplaySegmentId : "a" , firstEventAt : d ( 1000 ) , lastEventAt : d ( 5000 ) , eventCount : 1 } ,
53+ { sessionReplaySegmentId : "b" , firstEventAt : d ( 2000 ) , lastEventAt : d ( 4000 ) , eventCount : 1 } ,
5454 ] ) ;
5555 const { globalStartTs } = computeGlobalTimeline ( streams ) ;
5656
0 commit comments