aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/util
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-11-02 14:42:40 +0200
committerGitHub <[email protected]>2020-11-02 14:42:40 +0200
commit71010cb1e99c95619e71f271e941e7edb0c6ea37 (patch)
treeef3817b7081b83f710a7f1966c1be082330b3ae1 /js/tests/unit/util
parente0b8fcdf899aa1c25fe2ddf050452f7451ed0cdd (diff)
downloadbootstrap-71010cb1e99c95619e71f271e941e7edb0c6ea37.tar.xz
bootstrap-71010cb1e99c95619e71f271e941e7edb0c6ea37.zip
tests: switch to using `toContain()` to check for substring presence (#32043)
Diffstat (limited to 'js/tests/unit/util')
-rw-r--r--js/tests/unit/util/sanitizer.spec.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/tests/unit/util/sanitizer.spec.js b/js/tests/unit/util/sanitizer.spec.js
index dcfad8436..395875d62 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.indexOf('script') === -1).toEqual(true)
+ expect(result).not.toContain('script')
})
it('should allow aria attributes and safe attributes', () => {
@@ -32,8 +32,8 @@ describe('Sanitizer', () => {
const result = sanitizeHtml(template, DefaultAllowlist, null)
- expect(result.indexOf('aria-pressed') !== -1).toEqual(true)
- expect(result.indexOf('class="test"') !== -1).toEqual(true)
+ expect(result).toContain('aria-pressed')
+ expect(result).toContain('class="test"')
})
it('should remove tags not in allowlist', () => {
@@ -45,7 +45,7 @@ describe('Sanitizer', () => {
const result = sanitizeHtml(template, DefaultAllowlist, null)
- expect(result.indexOf('<script>') === -1).toEqual(true)
+ expect(result).not.toContain('<script>')
})
it('should not use native api to sanitize if a custom function passed', () => {