From: XhmikosR Date: Mon, 2 Nov 2020 12:49:56 +0000 (+0200) Subject: tests: fix sanitizer test. (#32045) X-Git-Tag: v5.0.0-alpha3~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2697b05733e2b8a88d35912d604644862d609b4;p=thirdparty%2Fbootstrap.git tests: fix sanitizer test. (#32045) The test template does not include a `script` tag so the test always returned true. --- diff --git a/js/tests/unit/util/sanitizer.spec.js b/js/tests/unit/util/sanitizer.spec.js index 395875d624..869b8c5615 100644 --- a/js/tests/unit/util/sanitizer.spec.js +++ b/js/tests/unit/util/sanitizer.spec.js @@ -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', () => {