CyTube/test/xss.js

13 lines
448 B
JavaScript
Raw Normal View History

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';
const expected = '`^~=| _-,;:!?/."()[]{}@$*\\\\&#%+á\t';
assert.strictEqual(XSS.sanitizeHTML(input), expected);
});
});
});