Skip to content

Commit 359bcc6

Browse files
committed
fix default unmask tests
1 parent c48d5b2 commit 359bcc6

File tree

7 files changed

+26
-82
lines changed

7 files changed

+26
-82
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<body>
88
<button aria-label="Click me" onclick="console.log('Test log')">Click me</button>
99
<div>This should be masked by default</div>
10-
<div data-sentry-unmask>This should be unmasked due to data attribute</div>
10+
<div data-sentry-unmask>With default settings, this should also be masked (even with data attribute)</div>
1111
<input placeholder="Placeholder should be masked" />
12-
<input data-sentry-unmask placeholder="Placeholder can be unmasked" />
12+
<input data-sentry-unmask placeholder="Placeholder can be unmasked - but not with default settings" />
1313
<div title="Title should be masked">Title should be masked</div>
1414
<svg style="width:200px;height:200px" viewBox="0 0 80 80"><path d=""/><area /><rect /></svg>
1515
<svg style="width:200px;height:200px" viewBox="0 0 80 80" data-sentry-unblock><path d=""/><area /><rect /></svg>

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

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"childNodes": [
107107
{
108108
"type": 3,
109-
"textContent": "This should be unmasked due to data attribute",
109+
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
110110
"id": 17
111111
}
112112
],
@@ -136,7 +136,7 @@
136136
"tagName": "input",
137137
"attributes": {
138138
"data-sentry-unmask": "",
139-
"placeholder": "Placeholder can be unmasked"
139+
"placeholder": "*********** *** ** ******** * *** *** **** ******* ********"
140140
},
141141
"childNodes": [],
142142
"id": 21
@@ -186,38 +186,10 @@
186186
"type": 2,
187187
"tagName": "svg",
188188
"attributes": {
189-
"style": "width:200px;height:200px",
190-
"viewBox": "0 0 80 80",
191-
"data-sentry-unblock": ""
189+
"rr_width": "[200-250]px",
190+
"rr_height": "[200-250]px"
192191
},
193-
"childNodes": [
194-
{
195-
"type": 2,
196-
"tagName": "path",
197-
"attributes": {
198-
"d": ""
199-
},
200-
"childNodes": [],
201-
"isSVG": true,
202-
"id": 29
203-
},
204-
{
205-
"type": 2,
206-
"tagName": "area",
207-
"attributes": {},
208-
"childNodes": [],
209-
"isSVG": true,
210-
"id": 30
211-
},
212-
{
213-
"type": 2,
214-
"tagName": "rect",
215-
"attributes": {},
216-
"childNodes": [],
217-
"isSVG": true,
218-
"id": 31
219-
}
220-
],
192+
"childNodes": [],
221193
"isSVG": true,
222194
"id": 28
223195
},
@@ -245,9 +217,8 @@
245217
"type": 2,
246218
"tagName": "img",
247219
"attributes": {
248-
"data-sentry-unblock": "",
249-
"style": "width:100px;height:100px",
250-
"src": "file:///none.png"
220+
"rr_width": "[100-150]px",
221+
"file:///none.pngrr_height": "[100-150]px"
251222
},
252223
"childNodes": [],
253224
"id": 35
@@ -292,4 +263,4 @@
292263
}
293264
},
294265
"timestamp": [timestamp]
295-
}
266+
}

dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy-firefox.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"childNodes": [
107107
{
108108
"type": 3,
109-
"textContent": "This should be unmasked due to data attribute",
109+
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
110110
"id": 17
111111
}
112112
],
@@ -248,4 +248,4 @@
248248
}
249249
},
250250
"timestamp": [timestamp]
251-
}
251+
}

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

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"childNodes": [
107107
{
108108
"type": 3,
109-
"textContent": "This should be unmasked due to data attribute",
109+
"textContent": "**** ****** ** ******** *** ** **** *********",
110110
"id": 17
111111
}
112112
],
@@ -136,7 +136,7 @@
136136
"tagName": "input",
137137
"attributes": {
138138
"data-sentry-unmask": "",
139-
"placeholder": "Placeholder can be unmasked"
139+
"placeholder": "*********** *** ** ********"
140140
},
141141
"childNodes": [],
142142
"id": 21
@@ -186,38 +186,10 @@
186186
"type": 2,
187187
"tagName": "svg",
188188
"attributes": {
189-
"style": "width:200px;height:200px",
190-
"viewBox": "0 0 80 80",
191-
"data-sentry-unblock": ""
192-
},
193-
"childNodes": [
194-
{
195-
"type": 2,
196-
"tagName": "path",
197-
"attributes": {
198-
"d": ""
199-
},
200-
"childNodes": [],
201-
"isSVG": true,
202-
"id": 29
203-
},
204-
{
205-
"type": 2,
206-
"tagName": "area",
207-
"attributes": {},
208-
"childNodes": [],
209-
"isSVG": true,
210-
"id": 30
211-
},
212-
{
213-
"type": 2,
214-
"tagName": "rect",
215-
"attributes": {},
216-
"childNodes": [],
217-
"isSVG": true,
218-
"id": 31
219-
}
220-
],
189+
"rr_width": "[200-250]px",
190+
"rr_height": "[200-250]px"
191+
},
192+
"childNodes": [],
221193
"isSVG": true,
222194
"id": 28
223195
},
@@ -245,9 +217,8 @@
245217
"type": 2,
246218
"tagName": "img",
247219
"attributes": {
248-
"data-sentry-unblock": "",
249-
"style": "width:100px;height:100px",
250-
"src": "file:///none.png"
220+
"rr_width": "[100-150]px",
221+
"file:///none.pngrr_height": "[100-150]px"
251222
},
252223
"childNodes": [],
253224
"id": 35
@@ -292,4 +263,4 @@
292263
}
293264
},
294265
"timestamp": [timestamp]
295-
}
266+
}

dev-packages/browser-integration-tests/suites/replay/privacyDefault/test.ts-snapshots/privacy.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"childNodes": [
107107
{
108108
"type": 3,
109-
"textContent": "This should be unmasked due to data attribute",
109+
"textContent": "**** ******* ********* **** ****** **** ** ****** ***** **** **** **********",
110110
"id": 17
111111
}
112112
],
@@ -136,7 +136,7 @@
136136
"tagName": "input",
137137
"attributes": {
138138
"data-sentry-unmask": "",
139-
"placeholder": "Placeholder can be unmasked"
139+
"placeholder": "*********** *** ** ******** * *** *** **** ******* ********"
140140
},
141141
"childNodes": [],
142142
"id": 21
@@ -292,4 +292,4 @@
292292
}
293293
},
294294
"timestamp": [timestamp]
295-
}
295+
}

dev-packages/browser-integration-tests/suites/replay/privacyInput/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ window.Replay = Sentry.replayIntegration({
77
minReplayDuration: 0,
88
useCompression: false,
99
maskAllInputs: false,
10+
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
1011
});
1112

1213
Sentry.init({

dev-packages/browser-integration-tests/suites/replay/privacyInputMaskAll/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ window.Replay = Sentry.replayIntegration({
77
minReplayDuration: 0,
88
useCompression: false,
99
maskAllInputs: true,
10+
unmask: ['.sentry-unmask, [data-sentry-unmask]'],
1011
});
1112

1213
Sentry.init({

0 commit comments

Comments
 (0)