Skip to content

Commit c9f2805

Browse files
evilpiemoz-wptsync-bot
authored andcommitted
Update Sanitizer tests.
Differential Revision: https://phabricator.services.mozilla.com/D259983 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1963612 gecko-commit: 93fd7858ec8d7a607abaed55a1cab29e2503a5a2 gecko-reviewers: emilio
1 parent 27125ea commit c9f2805

5 files changed

+640
-32
lines changed

sanitizer-api/sanitizer-basic-filtering.tentative.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,6 @@
151151
| data-y="2"
152152
| data-z="3"
153153

154-
155-
#data
156-
<p data-x="1" data-y="2" data-z="3">
157-
#config
158-
{
159-
"removeAttributes": ["data-z"],
160-
"dataAttributes": true
161-
}
162-
#document
163-
| <p>
164-
| data-x="1"
165-
| data-y="2"
166-
167154
#data
168155
<p data-x="1" data-y="2" data-z="3">
169156
#config

sanitizer-api/sanitizer-config.tentative.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848

4949
test(t => {
5050
assert_false(new Sanitizer().get().dataAttributes);
51-
assert_true(new Sanitizer({}).get().dataAttributes);
52-
assert_true(new Sanitizer({dataAttributes: true}).get().dataAttributes);
53-
assert_false(new Sanitizer({dataAttributes: false}).get().dataAttributes);
51+
assert_true(new Sanitizer({ attributes: [] }).get().dataAttributes);
52+
assert_false('dataAttributes' in new Sanitizer({}).get());
53+
assert_false('dataAttributes' in new Sanitizer({ removeAttributes: [] }).get());
54+
assert_true(new Sanitizer({ attributes: [], dataAttributes: true}).get().dataAttributes);
55+
assert_false(new Sanitizer({ attributes: [], dataAttributes: false}).get().dataAttributes);
5456

5557
let s = new Sanitizer();
5658
s.setDataAttributes(true);

0 commit comments

Comments
 (0)