Skip to content

Commit 7c066e2

Browse files
petebacondarwinnetman92
authored andcommitted
test(ngSanitize): add tests for decodeEntities
1 parent 93ab22b commit 7c066e2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/ngSanitize/sanitizeSpec.js

+10
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,16 @@ describe('decodeEntities', function() {
515515
window.hiddenPre = origHiddenPre;
516516
});
517517

518+
it('should unescape text', function() {
519+
htmlParser('a<div>&</div>c', handler);
520+
expect(text).toEqual('a<div>&</div>c');
521+
});
522+
523+
it('should preserve whitespace', function() {
524+
htmlParser(' a&amp;b ', handler);
525+
expect(text).toEqual(' a&b ');
526+
});
527+
518528
it('should use innerText if textContent is not available (IE<9)', function() {
519529
window.hiddenPre = {
520530
innerText: 'INNER_TEXT'

0 commit comments

Comments
 (0)