Skip to content

Commit

Permalink
feat: add forked sentry tests
Browse files Browse the repository at this point in the history
This adds tests for the features that Sentry has added
  • Loading branch information
billyvg committed Jul 6, 2023
1 parent 46df5cd commit 1209595
Show file tree
Hide file tree
Showing 10 changed files with 992 additions and 11 deletions.
438 changes: 438 additions & 0 deletions packages/rrweb/test/events/shadow-dom-sentry.ts

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions packages/rrweb/test/html/attributes-mask.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!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>attributes mask</title>
</head>

<body>
<form>
<div title="Test title" aria-label="Test aria label" class="rr-unmask">
Test content
</div>

<div title="Test title 2" aria-label="Test aria label 2">
Test content 2
</div>

<input type="text" placeholder="Test placeholder 1" class="rr-unmask"/>
<input type="text" placeholder="Test placeholder 2" class=""/>

<input type="submit" value="Submit button 1" class="rr-unmask" />
<input type="submit" value="Submit button 2" class="" />

<input type="button" value="Button 1" class="" />
</form>
</body>
</html>
8 changes: 8 additions & 0 deletions packages/rrweb/test/html/block.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@
<div class="rr-block" style="width: 50px; height: 50px;">
<input type="text" /> <span id="text"></span>
</div>

<img class="rr-block" src="#href" />
<img href="#href" />
<img class="rr-unblock" src="#href" />

<svg class="rr-block" viewBox="0 0 80 80"><path d="M79 71.91a7.32 7.32 0 0 0 0-7.38L46.4 8A7.22 7.22 0 0 0 40 4.37 7.33 7.33 0 0 0 33.62 8L23.06 26.33l2.66 1.54A51.42 51.42 0 0 1 44.6 46.75a50.41 50.41 0 0 1 6.81 22.72H44a44.34 44.34 0 0 0-5.84-19A43.76 43.76 0 0 0 22.07 34.2l-2.66-1.54-9.83 17.13 2.65 1.54A24.9 24.9 0 0 1 24.3 69.47H7.39a1.2 1.2 0 0 1-1.06-.59 1.21 1.21 0 0 1 0-1.23l4.73-8.14a17.67 17.67 0 0 0-5.38-3.08L1 64.57A7.34 7.34 0 0 0 1 72a7.25 7.25 0 0 0 6.39 3.67h23.24v-3.12a31.32 31.32 0 0 0-4.09-15.38 31.26 31.26 0 0 0-8.67-9.57l3.71-6.39a38 38 0 0 1 11.33 12.28 38.1 38.1 0 0 1 5.1 19v3.08h19.68v-3.02a57.52 57.52 0 0 0-7.76-28.88A57.48 57.48 0 0 0 31.47 24.1l7.51-13a1.18 1.18 0 0 1 1.02-.57 1.16 1.16 0 0 1 1.05.59L73.7 67.61a1.2 1.2 0 0 1 0 1.22 1.13 1.13 0 0 1-1.06.59H65c.1 2.07.1 4.09 0 6.16h7.65A7.1 7.1 0 0 0 79 71.91z"/></svg>
<svg viewBox="0 0 80 80"><path d="M79 71.91a7.32 7.32 0 0 0 0-7.38L46.4 8A7.22 7.22 0 0 0 40 4.37 7.33 7.33 0 0 0 33.62 8L23.06 26.33l2.66 1.54A51.42 51.42 0 0 1 44.6 46.75a50.41 50.41 0 0 1 6.81 22.72H44a44.34 44.34 0 0 0-5.84-19A43.76 43.76 0 0 0 22.07 34.2l-2.66-1.54-9.83 17.13 2.65 1.54A24.9 24.9 0 0 1 24.3 69.47H7.39a1.2 1.2 0 0 1-1.06-.59 1.21 1.21 0 0 1 0-1.23l4.73-8.14a17.67 17.67 0 0 0-5.38-3.08L1 64.57A7.34 7.34 0 0 0 1 72a7.25 7.25 0 0 0 6.39 3.67h23.24v-3.12a31.32 31.32 0 0 0-4.09-15.38 31.26 31.26 0 0 0-8.67-9.57l3.71-6.39a38 38 0 0 1 11.33 12.28 38.1 38.1 0 0 1 5.1 19v3.08h19.68v-3.02a57.52 57.52 0 0 0-7.76-28.88A57.48 57.48 0 0 0 31.47 24.1l7.51-13a1.18 1.18 0 0 1 1.02-.57 1.16 1.16 0 0 1 1.05.59L73.7 67.61a1.2 1.2 0 0 1 0 1.22 1.13 1.13 0 0 1-1.06.59H65c.1 2.07.1 4.09 0 6.16h7.65A7.1 7.1 0 0 0 79 71.91z"/></svg>
<svg class="rr-unblock" viewBox="0 0 80 80"><path d="M79 71.91a7.32 7.32 0 0 0 0-7.38L46.4 8A7.22 7.22 0 0 0 40 4.37 7.33 7.33 0 0 0 33.62 8L23.06 26.33l2.66 1.54A51.42 51.42 0 0 1 44.6 46.75a50.41 50.41 0 0 1 6.81 22.72H44a44.34 44.34 0 0 0-5.84-19A43.76 43.76 0 0 0 22.07 34.2l-2.66-1.54-9.83 17.13 2.65 1.54A24.9 24.9 0 0 1 24.3 69.47H7.39a1.2 1.2 0 0 1-1.06-.59 1.21 1.21 0 0 1 0-1.23l4.73-8.14a17.67 17.67 0 0 0-5.38-3.08L1 64.57A7.34 7.34 0 0 0 1 72a7.25 7.25 0 0 0 6.39 3.67h23.24v-3.12a31.32 31.32 0 0 0-4.09-15.38 31.26 31.26 0 0 0-8.67-9.57l3.71-6.39a38 38 0 0 1 11.33 12.28 38.1 38.1 0 0 1 5.1 19v3.08h19.68v-3.02a57.52 57.52 0 0 0-7.76-28.88A57.48 57.48 0 0 0 31.47 24.1l7.51-13a1.18 1.18 0 0 1 1.02-.57 1.16 1.16 0 0 1 1.05.59L73.7 67.61a1.2 1.2 0 0 1 0 1.22 1.13 1.13 0 0 1-1.06.59H65c.1 2.07.1 4.09 0 6.16h7.65A7.1 7.1 0 0 0 79 71.91z"/></svg>
</body>
</html>
41 changes: 41 additions & 0 deletions packages/rrweb/test/html/form-masked.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!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 for="text">
<input type="text" class="rr-mask"/>
</label>
<label>
<input type="radio" class="rr-mask" name="toggle" value="on" />
</label>
<label>
<input type="radio" class="rr-mask" name="toggle" value="off" checked />
</label>
<label for="checkbox">
<input type="checkbox" class="rr-mask" />
</label>
<label for="textarea">
<textarea name="" id="" cols="30" rows="10" class="rr-mask"></textarea>
</label>
<label for="select">
<select name="" id="" class="rr-mask">
<option value="1">1</option>
<option value="2">2</option>
</select>
</label>
<label for="password">
<input type="password" class="rr-mask" />
</label>
<label for="empty">
<input id="empty" class="rr-mask" />
</label>
</form>
</body>
</html>
28 changes: 22 additions & 6 deletions packages/rrweb/test/html/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,42 @@
<input type="text" />
</label>
<label>
<input type="radio" name="toggle" value="on" />
<input type="color" />
</label>
<label>
<input type="radio" name="toggle" value="off" checked />
<input type="radio" name="toggle" />
</label>
<label>
<input type="radio" name="toggle" value="radio-on" />
</label>
<label>
<input type="radio" name="toggle" value="radio-off" checked />
</label>
<label for="checkbox">
<input type="checkbox" />
<input type="checkbox" checked />
</label>
<label>
<input type="checkbox" value="check-val" />
</label>
<label for="textarea">
<textarea name="" id="" cols="30" rows="10" data-unmask-example="true"></textarea>
</label>
<label for="select">
<select name="" id="">
<option value="1">1</option>
<option value="2">2</option>
<select name="" id="" value="1">
<option value="1">Option A</option>
<option value="2">Option BB</option>
</select>
</label>
<label for="password">
<input type="password" />
</label>
<label for="empty">
<input id="empty" />
</label>
<label for="unmask">
<input type="text" class="rr-unmask" />
</label>
<input type="submit" value="Submit form" />
</form>
</body>
</html>
10 changes: 10 additions & 0 deletions packages/rrweb/test/html/mask-text.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@
<div>mask3</div>
</div>
</div>
<div>
mask4
</div>
<div class="rr-unmask">
mask5
</div>
<input placeholder="mask6" />
<div title="mask7" />
<button aria-label="mask8">mask9</button>
<textarea>mask10</textarea>
</body>
</html>
Loading

0 comments on commit 1209595

Please sign in to comment.