debian-mirror-gitlab/spec/javascripts/issue_show/index_spec.js

20 lines
576 B
JavaScript
Raw Normal View History

2018-11-08 19:23:39 +05:30
import initIssueableApp from '~/issue_show';
describe('Issue show index', () => {
describe('initIssueableApp', () => {
it('should initialize app with no potential XSS attack', () => {
const d = document.createElement('div');
d.id = 'js-issuable-app-initial-data';
d.innerHTML = JSON.stringify({
initialDescriptionHtml: '<img src=x onerror=alert(1)>',
});
document.body.appendChild(d);
const alertSpy = spyOn(window, 'alert');
initIssueableApp();
expect(alertSpy).not.toHaveBeenCalled();
});
});
});