From 79d1fe2810b40efb032a917377dc1a7487f1a683 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 1 Feb 2024 17:03:13 +0100 Subject: [PATCH] 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 https://github.com/getsentry/sentry-javascript/issues/10258 --- .../__snapshots__/integration.test.ts.snap | 73 +++++++++++++++++++ .../html/form-fields-sensitive-update.html | 43 +++++++++++ .../test/html/form-fields-sensitive.html | 38 ++++++++++ 3 files changed, 154 insertions(+) create mode 100644 packages/rrweb-snapshot/test/html/form-fields-sensitive-update.html create mode 100644 packages/rrweb-snapshot/test/html/form-fields-sensitive.html diff --git a/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap b/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap index be122f386c..30fa232b9d 100644 --- a/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap +++ b/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap @@ -265,6 +265,79 @@ exports[`integration tests [html file]: form-fields.html 1`] = ` " `; +exports[`integration tests [html file]: form-fields-sensitive.html 1`] = ` +" + + + + form fields + +
+ + + + + + + + +
+ " +`; + +exports[`integration tests [html file]: form-fields-sensitive-update.html 1`] = ` +" + + + + form fields + +
+ + + + + + + + +
+ + " +`; + exports[`integration tests [html file]: hover.html 1`] = ` " diff --git a/packages/rrweb-snapshot/test/html/form-fields-sensitive-update.html b/packages/rrweb-snapshot/test/html/form-fields-sensitive-update.html new file mode 100644 index 0000000000..9d9379a9e8 --- /dev/null +++ b/packages/rrweb-snapshot/test/html/form-fields-sensitive-update.html @@ -0,0 +1,43 @@ + + + + + + + form fields + + + +
+ + + + + + + + +
+ + + diff --git a/packages/rrweb-snapshot/test/html/form-fields-sensitive.html b/packages/rrweb-snapshot/test/html/form-fields-sensitive.html new file mode 100644 index 0000000000..c92d33f23b --- /dev/null +++ b/packages/rrweb-snapshot/test/html/form-fields-sensitive.html @@ -0,0 +1,38 @@ + + + + + + + form fields + + + +
+ + + + + + + + +
+ +