Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2516569

Browse files
committed
test(ngSanitize) Add tests for decodeEntities
1 parent 9f7c5ce commit 2516569

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/ngSanitize/sanitizeSpec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,16 @@ describe('decodeEntities', function() {
506506
afterEach(function() {
507507
window.hiddenPre = origHiddenPre;
508508
});
509+
510+
it('should unescape text', function() {
511+
htmlParser('a<div>&</div>c', handler)
512+
expect(text).toEqual('a<div>&</div>c');
513+
});
514+
515+
it('should preserve whitespace', function() {
516+
htmlParser(' a&amp;b ', handler)
517+
expect(text).toEqual(' a&b ');
518+
});
509519

510520
it('should use innerText if textContent is not available (IE<9)', function() {
511521
window.hiddenPre = {

0 commit comments

Comments
 (0)