@@ -9,13 +9,13 @@ describe('integration settings', () => {
9
9
it ( 'sets the correct configuration when `blockAllMedia` is disabled' , async ( ) => {
10
10
const { replay } = await mockSdk ( { replayOptions : { blockAllMedia : false } } ) ;
11
11
12
- expect ( replay . recordingOptions . blockSelector ) . toBe ( '[data-sentry-block]' ) ;
12
+ expect ( replay [ '_recordingOptions' ] . blockSelector ) . toBe ( '[data-sentry-block]' ) ;
13
13
} ) ;
14
14
15
15
it ( 'sets the correct configuration when `blockSelector` is empty and `blockAllMedia` is enabled' , async ( ) => {
16
16
const { replay } = await mockSdk ( { replayOptions : { blockSelector : '' } } ) ;
17
17
18
- expect ( replay . recordingOptions . blockSelector ) . toMatchInlineSnapshot (
18
+ expect ( replay [ '_recordingOptions' ] . blockSelector ) . toMatchInlineSnapshot (
19
19
'"img,image,svg,path,rect,area,video,object,picture,embed,map,audio"' ,
20
20
) ;
21
21
} ) ;
@@ -25,7 +25,7 @@ describe('integration settings', () => {
25
25
replayOptions : { blockSelector : '[data-test-blockSelector]' } ,
26
26
} ) ;
27
27
28
- expect ( replay . recordingOptions . blockSelector ) . toMatchInlineSnapshot (
28
+ expect ( replay [ '_recordingOptions' ] . blockSelector ) . toMatchInlineSnapshot (
29
29
'"[data-test-blockSelector],img,image,svg,path,rect,area,video,object,picture,embed,map,audio"' ,
30
30
) ;
31
31
} ) ;
@@ -48,7 +48,7 @@ describe('integration settings', () => {
48
48
sentryOptions : { replaysSessionSampleRate : undefined } ,
49
49
} ) ;
50
50
51
- expect ( replay . options . sessionSampleRate ) . toBe ( 0.5 ) ;
51
+ expect ( replay . getOptions ( ) . sessionSampleRate ) . toBe ( 0.5 ) ;
52
52
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
53
53
} ) ;
54
54
@@ -58,21 +58,21 @@ describe('integration settings', () => {
58
58
sentryOptions : { replaysSessionSampleRate : undefined } ,
59
59
} ) ;
60
60
61
- expect ( replay . options . sessionSampleRate ) . toBe ( 0 ) ;
61
+ expect ( replay . getOptions ( ) . sessionSampleRate ) . toBe ( 0 ) ;
62
62
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
63
63
} ) ;
64
64
65
65
it ( 'works with defining settings in SDK' , async ( ) => {
66
66
const { replay } = await mockSdk ( { sentryOptions : { replaysSessionSampleRate : 0.5 } , replayOptions : { } } ) ;
67
67
68
- expect ( replay . options . sessionSampleRate ) . toBe ( 0.5 ) ;
68
+ expect ( replay . getOptions ( ) . sessionSampleRate ) . toBe ( 0.5 ) ;
69
69
expect ( mockConsole ) . toBeCalledTimes ( 0 ) ;
70
70
} ) ;
71
71
72
72
it ( 'works with defining 0 in SDK' , async ( ) => {
73
73
const { replay } = await mockSdk ( { sentryOptions : { replaysSessionSampleRate : 0 } , replayOptions : { } } ) ;
74
74
75
- expect ( replay . options . sessionSampleRate ) . toBe ( 0 ) ;
75
+ expect ( replay . getOptions ( ) . sessionSampleRate ) . toBe ( 0 ) ;
76
76
expect ( mockConsole ) . toBeCalledTimes ( 0 ) ;
77
77
} ) ;
78
78
@@ -82,7 +82,7 @@ describe('integration settings', () => {
82
82
replayOptions : { sessionSampleRate : 0.1 } ,
83
83
} ) ;
84
84
85
- expect ( replay . options . sessionSampleRate ) . toBe ( 0.5 ) ;
85
+ expect ( replay . getOptions ( ) . sessionSampleRate ) . toBe ( 0.5 ) ;
86
86
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
87
87
} ) ;
88
88
@@ -92,7 +92,7 @@ describe('integration settings', () => {
92
92
replayOptions : { sessionSampleRate : 0.1 } ,
93
93
} ) ;
94
94
95
- expect ( replay . options . sessionSampleRate ) . toBe ( 0 ) ;
95
+ expect ( replay . getOptions ( ) . sessionSampleRate ) . toBe ( 0 ) ;
96
96
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
97
97
} ) ;
98
98
} ) ;
@@ -114,7 +114,7 @@ describe('integration settings', () => {
114
114
sentryOptions : { replaysOnErrorSampleRate : undefined } ,
115
115
} ) ;
116
116
117
- expect ( replay . options . errorSampleRate ) . toBe ( 0.5 ) ;
117
+ expect ( replay . getOptions ( ) . errorSampleRate ) . toBe ( 0.5 ) ;
118
118
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
119
119
} ) ;
120
120
@@ -124,21 +124,21 @@ describe('integration settings', () => {
124
124
sentryOptions : { replaysOnErrorSampleRate : undefined } ,
125
125
} ) ;
126
126
127
- expect ( replay . options . errorSampleRate ) . toBe ( 0 ) ;
127
+ expect ( replay . getOptions ( ) . errorSampleRate ) . toBe ( 0 ) ;
128
128
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
129
129
} ) ;
130
130
131
131
it ( 'works with defining settings in SDK' , async ( ) => {
132
132
const { replay } = await mockSdk ( { sentryOptions : { replaysOnErrorSampleRate : 0.5 } , replayOptions : { } } ) ;
133
133
134
- expect ( replay . options . errorSampleRate ) . toBe ( 0.5 ) ;
134
+ expect ( replay . getOptions ( ) . errorSampleRate ) . toBe ( 0.5 ) ;
135
135
expect ( mockConsole ) . toBeCalledTimes ( 0 ) ;
136
136
} ) ;
137
137
138
138
it ( 'works with defining 0 in SDK' , async ( ) => {
139
139
const { replay } = await mockSdk ( { sentryOptions : { replaysOnErrorSampleRate : 0 } , replayOptions : { } } ) ;
140
140
141
- expect ( replay . options . errorSampleRate ) . toBe ( 0 ) ;
141
+ expect ( replay . getOptions ( ) . errorSampleRate ) . toBe ( 0 ) ;
142
142
expect ( mockConsole ) . toBeCalledTimes ( 0 ) ;
143
143
} ) ;
144
144
@@ -148,7 +148,7 @@ describe('integration settings', () => {
148
148
replayOptions : { errorSampleRate : 0.1 } ,
149
149
} ) ;
150
150
151
- expect ( replay . options . errorSampleRate ) . toBe ( 0.5 ) ;
151
+ expect ( replay . getOptions ( ) . errorSampleRate ) . toBe ( 0.5 ) ;
152
152
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
153
153
} ) ;
154
154
@@ -158,7 +158,7 @@ describe('integration settings', () => {
158
158
replayOptions : { errorSampleRate : 0.1 } ,
159
159
} ) ;
160
160
161
- expect ( replay . options . errorSampleRate ) . toBe ( 0 ) ;
161
+ expect ( replay . getOptions ( ) . errorSampleRate ) . toBe ( 0 ) ;
162
162
expect ( mockConsole ) . toBeCalledTimes ( 1 ) ;
163
163
} ) ;
164
164
} ) ;
@@ -168,25 +168,25 @@ describe('integration settings', () => {
168
168
const { replay } = await mockSdk ( { replayOptions : { } } ) ;
169
169
170
170
// Default is true
171
- expect ( replay . recordingOptions . maskTextSelector ) . toBe ( '*' ) ;
171
+ expect ( replay [ '_recordingOptions' ] . maskTextSelector ) . toBe ( '*' ) ;
172
172
} ) ;
173
173
174
174
it ( 'works with true' , async ( ) => {
175
175
const { replay } = await mockSdk ( { replayOptions : { maskAllText : true } } ) ;
176
176
177
- expect ( replay . recordingOptions . maskTextSelector ) . toBe ( '*' ) ;
177
+ expect ( replay [ '_recordingOptions' ] . maskTextSelector ) . toBe ( '*' ) ;
178
178
} ) ;
179
179
180
180
it ( 'works with false' , async ( ) => {
181
181
const { replay } = await mockSdk ( { replayOptions : { maskAllText : false } } ) ;
182
182
183
- expect ( replay . recordingOptions . maskTextSelector ) . toBe ( undefined ) ;
183
+ expect ( replay [ '_recordingOptions' ] . maskTextSelector ) . toBe ( undefined ) ;
184
184
} ) ;
185
185
186
186
it ( 'overwrites custom maskTextSelector option' , async ( ) => {
187
187
const { replay } = await mockSdk ( { replayOptions : { maskAllText : true , maskTextSelector : '[custom]' } } ) ;
188
188
189
- expect ( replay . recordingOptions . maskTextSelector ) . toBe ( '*' ) ;
189
+ expect ( replay [ '_recordingOptions' ] . maskTextSelector ) . toBe ( '*' ) ;
190
190
} ) ;
191
191
} ) ;
192
192
@@ -197,7 +197,7 @@ describe('integration settings', () => {
197
197
sentryOptions : { } ,
198
198
} ) ;
199
199
200
- expect ( replay . options . _experiments ) . toEqual ( { captureExceptions : true } ) ;
200
+ expect ( replay . getOptions ( ) . _experiments ) . toEqual ( { captureExceptions : true } ) ;
201
201
} ) ;
202
202
203
203
it ( 'works without defining _experiments in integration' , async ( ) => {
@@ -206,7 +206,7 @@ describe('integration settings', () => {
206
206
sentryOptions : { } ,
207
207
} ) ;
208
208
209
- expect ( replay . options . _experiments ) . toEqual ( { } ) ;
209
+ expect ( replay . getOptions ( ) . _experiments ) . toEqual ( { } ) ;
210
210
} ) ;
211
211
} ) ;
212
212
} ) ;
0 commit comments