Skip to content

Commit 74dd18e

Browse files
authored
test(replay): Add additional tests for aria-label (#8675)
Adds additional tests for `aria-label`. Will be needed for rrweb2 upgrade
1 parent 89380eb commit 74dd18e

File tree

12 files changed

+146
-67
lines changed

12 files changed

+146
-67
lines changed

packages/browser-integration-tests/suites/replay/customEvents/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" />
55
</head>
66
<body>
7-
<div role="button" id="error" class="btn btn-error" aria-label="An Error">An Error</div>
7+
<div role="button" id="error" class="btn btn-error" aria-label="An Error in aria-label">An Error</div>
88
<button title="Button title">
99
<img id="img" alt="Alt Text" />
1010
</button>

packages/browser-integration-tests/suites/replay/customEvents/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ sentryTest(
112112
expect.arrayContaining([
113113
{
114114
...expectedClickBreadcrumb,
115-
message: 'body > div#error.btn.btn-error[aria-label="An Error"]',
115+
message: 'body > div#error.btn.btn-error[aria-label="An Error in aria-label"]',
116116
data: {
117117
nodeId: expect.any(Number),
118118
node: {
119119
attributes: {
120-
'aria-label': '** *****',
120+
'aria-label': '** ***** ** **********',
121121
class: 'btn btn-error',
122122
id: 'error',
123123
role: 'button',

packages/browser-integration-tests/suites/replay/privacyBlock/template.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<input placeholder="Placeholder should be masked" />
1212
<div title="Title should be masked">Title should be masked</div>
1313
<svg style="width:200px;height:200px" viewBox="0 0 80 80"><path d=""/><area /><rect /></svg>
14+
<div data-sentry-block>
15+
<div>This should be blocked</div>
16+
</div>
1417
<svg style="width:200px;height:200px" viewBox="0 0 80 80" data-sentry-unblock><path d=""/><area /><rect /></svg>
1518
<img style="width:100px;height:100px" src="file:///none.png" />
1619
<img data-sentry-unblock style="width:100px;height:100px" src="file:///none.png" />

packages/browser-integration-tests/suites/replay/privacyBlock/test.ts-snapshots/privacy-chromium.json

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@
194194
"textContent": "\n ",
195195
"id": 28
196196
},
197+
{
198+
"type": 2,
199+
"tagName": "div",
200+
"attributes": {
201+
"rr_width": "[1250-1300]px",
202+
"rr_height": "[0-50]px"
203+
},
204+
"childNodes": [],
205+
"id": 29
206+
},
207+
{
208+
"type": 3,
209+
"textContent": "\n ",
210+
"id": 30
211+
},
197212
{
198213
"type": 2,
199214
"tagName": "svg",
@@ -211,32 +226,32 @@
211226
},
212227
"childNodes": [],
213228
"isSVG": true,
214-
"id": 30
229+
"id": 32
215230
},
216231
{
217232
"type": 2,
218233
"tagName": "area",
219234
"attributes": {},
220235
"childNodes": [],
221236
"isSVG": true,
222-
"id": 31
237+
"id": 33
223238
},
224239
{
225240
"type": 2,
226241
"tagName": "rect",
227242
"attributes": {},
228243
"childNodes": [],
229244
"isSVG": true,
230-
"id": 32
245+
"id": 34
231246
}
232247
],
233248
"isSVG": true,
234-
"id": 29
249+
"id": 31
235250
},
236251
{
237252
"type": 3,
238253
"textContent": "\n ",
239-
"id": 33
254+
"id": 35
240255
},
241256
{
242257
"type": 2,
@@ -246,12 +261,12 @@
246261
"src": "file:///none.png"
247262
},
248263
"childNodes": [],
249-
"id": 34
264+
"id": 36
250265
},
251266
{
252267
"type": 3,
253268
"textContent": "\n ",
254-
"id": 35
269+
"id": 37
255270
},
256271
{
257272
"type": 2,
@@ -262,12 +277,12 @@
262277
"src": "file:///none.png"
263278
},
264279
"childNodes": [],
265-
"id": 36
280+
"id": 38
266281
},
267282
{
268283
"type": 3,
269284
"textContent": "\n ",
270-
"id": 37
285+
"id": 39
271286
},
272287
{
273288
"type": 2,
@@ -277,12 +292,12 @@
277292
"rr_height": "[0-50]px"
278293
},
279294
"childNodes": [],
280-
"id": 38
295+
"id": 40
281296
},
282297
{
283298
"type": 3,
284299
"textContent": "\n ",
285-
"id": 39
300+
"id": 41
286301
},
287302
{
288303
"type": 2,
@@ -293,17 +308,17 @@
293308
"rr_height": "[0-50]px"
294309
},
295310
"childNodes": [],
296-
"id": 40
311+
"id": 42
297312
},
298313
{
299314
"type": 3,
300315
"textContent": "\n ",
301-
"id": 41
316+
"id": 43
302317
},
303318
{
304319
"type": 3,
305320
"textContent": "\n\n",
306-
"id": 42
321+
"id": 44
307322
}
308323
],
309324
"id": 8

packages/browser-integration-tests/suites/replay/privacyBlock/test.ts-snapshots/privacy-webkit.json

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@
194194
"textContent": "\n ",
195195
"id": 28
196196
},
197+
{
198+
"type": 2,
199+
"tagName": "div",
200+
"attributes": {
201+
"rr_width": "[1250-1300]px",
202+
"rr_height": "[0-50]px"
203+
},
204+
"childNodes": [],
205+
"id": 29
206+
},
207+
{
208+
"type": 3,
209+
"textContent": "\n ",
210+
"id": 30
211+
},
197212
{
198213
"type": 2,
199214
"tagName": "svg",
@@ -211,32 +226,32 @@
211226
},
212227
"childNodes": [],
213228
"isSVG": true,
214-
"id": 30
229+
"id": 32
215230
},
216231
{
217232
"type": 2,
218233
"tagName": "area",
219234
"attributes": {},
220235
"childNodes": [],
221236
"isSVG": true,
222-
"id": 31
237+
"id": 33
223238
},
224239
{
225240
"type": 2,
226241
"tagName": "rect",
227242
"attributes": {},
228243
"childNodes": [],
229244
"isSVG": true,
230-
"id": 32
245+
"id": 34
231246
}
232247
],
233248
"isSVG": true,
234-
"id": 29
249+
"id": 31
235250
},
236251
{
237252
"type": 3,
238253
"textContent": "\n ",
239-
"id": 33
254+
"id": 35
240255
},
241256
{
242257
"type": 2,
@@ -246,12 +261,12 @@
246261
"src": "file:///none.png"
247262
},
248263
"childNodes": [],
249-
"id": 34
264+
"id": 36
250265
},
251266
{
252267
"type": 3,
253268
"textContent": "\n ",
254-
"id": 35
269+
"id": 37
255270
},
256271
{
257272
"type": 2,
@@ -262,12 +277,12 @@
262277
"src": "file:///none.png"
263278
},
264279
"childNodes": [],
265-
"id": 36
280+
"id": 38
266281
},
267282
{
268283
"type": 3,
269284
"textContent": "\n ",
270-
"id": 37
285+
"id": 39
271286
},
272287
{
273288
"type": 2,
@@ -277,12 +292,12 @@
277292
"rr_height": "[0-50]px"
278293
},
279294
"childNodes": [],
280-
"id": 38
295+
"id": 40
281296
},
282297
{
283298
"type": 3,
284299
"textContent": "\n ",
285-
"id": 39
300+
"id": 41
286301
},
287302
{
288303
"type": 2,
@@ -293,17 +308,17 @@
293308
"rr_height": "[0-50]px"
294309
},
295310
"childNodes": [],
296-
"id": 40
311+
"id": 42
297312
},
298313
{
299314
"type": 3,
300315
"textContent": "\n ",
301-
"id": 41
316+
"id": 43
302317
},
303318
{
304319
"type": 3,
305320
"textContent": "\n\n",
306-
"id": 42
321+
"id": 44
307322
}
308323
],
309324
"id": 8

packages/browser-integration-tests/suites/replay/privacyDefault/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<div>This should be masked by default</div>
1010
<div data-sentry-unmask>This should be unmasked due to data attribute</div>
1111
<input placeholder="Placeholder should be masked" />
12+
<input data-sentry-unmask placeholder="Placeholder can be unmasked" />
1213
<div title="Title should be masked">Title should be masked</div>
1314
<svg style="width:200px;height:200px" viewBox="0 0 80 80"><path d=""/><area /><rect /></svg>
1415
<svg style="width:200px;height:200px" viewBox="0 0 80 80" data-sentry-unblock><path d=""/><area /><rect /></svg>

0 commit comments

Comments
 (0)