forked from rrweb-io/rrweb
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add tests for masking of sensitive data (#165)
This tests masking of initial & updated values for password & credit card fields. You can see that for now credit card data is not masked, which demonstrates the current behavior. In a future PR we can then verify that our fixed masking is working. ref getsentry/sentry-javascript#10258
- Loading branch information
Showing
3 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/rrweb-snapshot/test/html/form-fields-sensitive-update.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>form fields</title> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<label> | ||
<input type="password" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="current-password" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="new-password" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-number" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-exp" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-exp-month" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-exp-year" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-csc" value="initial" /> | ||
</label> | ||
</form> | ||
</body> | ||
<script> | ||
document.querySelectorAll('input').forEach((input) => { | ||
input.value = 'new value'; | ||
}); | ||
</script> | ||
</html> |
38 changes: 38 additions & 0 deletions
38
packages/rrweb-snapshot/test/html/form-fields-sensitive.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | ||
<title>form fields</title> | ||
</head> | ||
|
||
<body> | ||
<form> | ||
<label> | ||
<input type="password" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="current-password" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="new-password" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-number" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-exp" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-exp-month" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-exp-year" value="initial" /> | ||
</label> | ||
<label> | ||
<input autocomplete="cc-csc" value="initial" /> | ||
</label> | ||
</form> | ||
</body> | ||
</html> |