]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
tests: fix sanitizer test. (#32045)
authorXhmikosR <xhmikosr@gmail.com>
Mon, 2 Nov 2020 12:49:56 +0000 (14:49 +0200)
committerGitHub <noreply@github.com>
Mon, 2 Nov 2020 12:49:56 +0000 (14:49 +0200)
The test template does not include a `script` tag so the test always returned true.

js/tests/unit/util/sanitizer.spec.js

index 395875d62402ed28e7d24171401aa16379506525..869b8c56158155de68e85afd5908078144547860 100644 (file)
@@ -20,7 +20,7 @@ describe('Sanitizer', () => {
 
       const result = sanitizeHtml(template, DefaultAllowlist, null)
 
-      expect(result).not.toContain('script')
+      expect(result).not.toContain('href="javascript:alert(7)')
     })
 
     it('should allow aria attributes and safe attributes', () => {