@@ -3,10 +3,8 @@ import type { Transport } from '@sentry/types';
3
3
import * as SentryUtils from '@sentry/utils' ;
4
4
5
5
import type { Replay } from '../../src' ;
6
- import { DEFAULT_FLUSH_MIN_DELAY , WINDOW } from '../../src/constants' ;
7
6
import type { ReplayContainer } from '../../src/replay' ;
8
7
import { clearSession } from '../../src/session/clearSession' ;
9
- import { addEvent } from '../../src/util/addEvent' ;
10
8
import * as SendReplayRequest from '../../src/util/sendReplayRequest' ;
11
9
import { BASE_TIMESTAMP , mockRrweb , mockSdk } from '../index' ;
12
10
import { useFakeTimers } from '../utils/use-fake-timers' ;
@@ -38,20 +36,19 @@ describe('Integration | beforeAddRecordingEvent', () => {
38
36
39
37
( { replay, integration } = await mockSdk ( {
40
38
replayOptions : {
41
- beforeAddRecordingEvent : ( event ) => {
39
+ beforeAddRecordingEvent : event => {
42
40
const eventData = event . data as Record < string , any > ;
43
41
44
42
if ( eventData . tag === 'breadcrumb' && eventData . payload . category === 'ui.click' ) {
45
-
46
43
return {
47
44
...event ,
48
45
data : {
49
46
...eventData ,
50
47
payload : {
51
48
...eventData . payload ,
52
49
message : 'beforeAddRecordingEvent' ,
53
- }
54
- }
50
+ } ,
51
+ } ,
55
52
} ;
56
53
}
57
54
@@ -106,7 +103,7 @@ describe('Integration | beforeAddRecordingEvent', () => {
106
103
await advanceTimers ( 5000 ) ;
107
104
108
105
expect ( replay ) . toHaveLastSentReplay ( {
109
- recordingPayloadHeader : { segment_id : 0 } ,
106
+ recordingPayloadHeader : { segment_id : 0 } ,
110
107
recordingData : JSON . stringify ( [
111
108
{
112
109
type : 5 ,
@@ -122,7 +119,6 @@ describe('Integration | beforeAddRecordingEvent', () => {
122
119
} ,
123
120
} ,
124
121
} ,
125
-
126
122
] ) ,
127
123
} ) ;
128
124
} ) ;
@@ -136,10 +132,8 @@ describe('Integration | beforeAddRecordingEvent', () => {
136
132
jest . runAllTimers ( ) ;
137
133
await new Promise ( process . nextTick ) ;
138
134
expect ( replay ) . toHaveLastSentReplay ( {
139
- recordingPayloadHeader : { segment_id : 0 } ,
140
- recordingData : JSON . stringify ( [
141
- { "data" :{ "isCheckout" :true } , "timestamp" :BASE_TIMESTAMP , "type" :2 }
142
- ] ) ,
135
+ recordingPayloadHeader : { segment_id : 0 } ,
136
+ recordingData : JSON . stringify ( [ { data : { isCheckout : true } , timestamp : BASE_TIMESTAMP , type : 2 } ] ) ,
143
137
} ) ;
144
138
} ) ;
145
139
} ) ;
0 commit comments