Skip to content

Commit 3068a46

Browse files
committed
Add test for ancestors
1 parent d2f9a28 commit 3068a46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,15 @@ test('sanitize()', function (t) {
608608
'should support required attributes'
609609
)
610610

611+
t.deepEqual(
612+
sanitize(h('div', h('li', 'text')), {
613+
tagNames: ['div', 'ul', 'li'],
614+
ancestors: {li: ['ul']}
615+
}),
616+
h('div', 'text'),
617+
'should support `ancestors` to enforce certain ancestors (rehypejs/rehype-sanitize#8)'
618+
)
619+
611620
t.end()
612621
})
613622

0 commit comments

Comments
 (0)