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

Commit 2015ed2

Browse files
test(ngSanitize): add tests for decodeEntities
1 parent 51faaff commit 2015ed2

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
@@ -514,6 +514,16 @@ describe('decodeEntities', function() {
514514
afterEach(function() {
515515
window.hiddenPre = origHiddenPre;
516516
});
517+
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+
});
517527

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

0 commit comments

Comments
 (0)