-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75bd5b1
commit 250deeb
Showing
11 changed files
with
1,225 additions
and
1,456 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const chai = require('chai'); | ||
const assert = chai.assert; | ||
const sinon = require('sinon'); | ||
const EscapingHelpers = require('../../../src/utilities/helpers/escaping-helpers'); | ||
|
||
describe('Iframe-helpers', () => { | ||
it('sanitizeHtml', () => { | ||
const text = '&<>"\''; | ||
const sanitizedHtml = EscapingHelpers.sanitizeHtml(text); | ||
assert.equal(sanitizedHtml, '&<>"''); | ||
}); | ||
|
||
it('sanitizeParam', () => { | ||
const param = '<>"\'/'; | ||
const sanitizedParam = EscapingHelpers.sanitizeParam(param); | ||
assert.equal(sanitizedParam, '<>"'/'); | ||
}); | ||
|
||
it('escapeRegExp', () => { | ||
const regex = '/*/'; | ||
const escapedRegexp = EscapingHelpers.escapeRegExp(regex); | ||
assert.equal(escapedRegexp, '\\/\\*\\/'); | ||
}); | ||
}); |
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
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.