Browse Source

Add tests.

Ian Rose 7 năm trước cách đây
mục cha
commit
18a26c537c
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  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);
+    });
+
   });
 
 });