2017-06-17 16:39:58 +00:00
|
|
|
const assert = require('assert');
|
|
|
|
const XSS = require('../lib/xss');
|
|
|
|
|
|
|
|
describe('XSS', () => {
|
|
|
|
describe('sanitizeHTML', () => {
|
|
|
|
it('behaves consistently w.r.t. special chars used in emotes', () => {
|
|
|
|
const input = '`^~=| _-,;:!?/."()[]{}@$*\\&#%+á\t';
|
2018-10-22 05:18:22 +00:00
|
|
|
const expected = '`^~=| _-,;:!?/."()[]{}@$*\\\\&#%+á\t';
|
2017-06-17 16:39:58 +00:00
|
|
|
assert.strictEqual(XSS.sanitizeHTML(input), expected);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|