-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #401 from extractus/8.0.11
v8.0.11
- Loading branch information
Showing
15 changed files
with
357 additions
and
387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ coverage | |
yarn.lock | ||
coverage.lcov | ||
pnpm-lock.yaml | ||
lcov.info | ||
|
||
deno.lock | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ coverage | |
pnpm-lock.yaml | ||
examples | ||
test-data | ||
lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
// config.test | ||
/* eslint-env jest */ | ||
import { describe, it } from 'node:test' | ||
import assert from 'node:assert' | ||
|
||
import { | ||
setSanitizeHtmlOptions, | ||
getSanitizeHtmlOptions | ||
} from './config.js' | ||
|
||
test('Testing setSanitizeHtmlOptions/getSanitizeHtmlOptions methods', () => { | ||
setSanitizeHtmlOptions({ | ||
allowedTags: ['div', 'span'], | ||
allowedAttributes: { | ||
describe('check config methods', () => { | ||
it('Testing setSanitizeHtmlOptions/getSanitizeHtmlOptions methods', () => { | ||
setSanitizeHtmlOptions({ | ||
allowedTags: ['div', 'span'], | ||
allowedAttributes: { | ||
a: ['href', 'title'], | ||
}, | ||
}) | ||
|
||
const actual = getSanitizeHtmlOptions() | ||
const actualAllowedAttributes = actual.allowedAttributes | ||
const expectedAllowedAttributes = { | ||
a: ['href', 'title'], | ||
}, | ||
}) | ||
} | ||
|
||
const actual = getSanitizeHtmlOptions() | ||
const actualAllowedAttributes = actual.allowedAttributes | ||
const expectedAllowedAttributes = { | ||
a: ['href', 'title'], | ||
} | ||
assert.deepEqual(actualAllowedAttributes, expectedAllowedAttributes) | ||
|
||
expect(actualAllowedAttributes).toEqual(expectedAllowedAttributes) | ||
const actualAllowedTags = actual.allowedTags | ||
const expectedAllowedTags = ['div', 'span'] | ||
assert.deepEqual(actualAllowedTags, expectedAllowedTags) | ||
|
||
const actualAllowedTags = actual.allowedTags | ||
const expectedAllowedTags = ['div', 'span'] | ||
expect(actualAllowedTags).toEqual(expectedAllowedTags) | ||
setSanitizeHtmlOptions({ | ||
allowedTags: [], | ||
}) | ||
|
||
setSanitizeHtmlOptions({ | ||
allowedTags: [], | ||
assert.deepEqual(getSanitizeHtmlOptions().allowedTags, []) | ||
}) | ||
|
||
expect(getSanitizeHtmlOptions().allowedTags).toEqual([]) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.