oy-vey
Version:
React utilities for building server-side email templates.
21 lines (17 loc) • 539 B
JavaScript
import CSS from '../CSS';
describe('CSS', function() {
it('should throw on unsafe css', function() {
const shouldThrowBecauseOfMozBinding = () => {
CSS.raiseOnUnsafeCSS(
'body{-moz-binding: url("http://www.website.com/xss.xml#test")}'
);
};
const shouldThrowBecauseOfExpression = () => {
CSS.raiseOnUnsafeCSS(
'body{xss:expr/*XSS*/ession(alert("XSS"))}'
);
};
expect(shouldThrowBecauseOfMozBinding).toThrow();
expect(shouldThrowBecauseOfExpression).toThrow();
});
});