浏览代码

Add tests.

Ian Rose 7 年之前
父节点
当前提交
18a26c537c
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      test/src/apputils/sanitizer.spec.ts

+ 12 - 0
test/src/apputils/sanitizer.spec.ts

@@ -63,6 +63,18 @@ describe('defaultSanitizer', () => {
       expect(defaultSanitizer.sanitize(div)).to.be(div);
     });
 
+    it('should allow video tags with some attributes', () => {
+      let video = '<video src="my/video.mp4" height="42" width="42"' +
+                  ' autoplay controls loop muted></video>';
+      expect(defaultSanitizer.sanitize(video)).to.be(video);
+    });
+
+    it('should allow audio tags with some attributes', () => {
+      let audio = '<audio src="my/audio.ogg autoplay loop ' +
+                  'controls muted"></audio>';
+      expect(defaultSanitizer.sanitize(audio)).to.be(audio);
+    });
+
   });
 
 });