summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-08 06:45:20 +0000
committerDouwe Maan <douwe@gitlab.com>2017-09-08 06:45:20 +0000
commitbce1c50928e4885d54dd11221a9c8197a7fb1a7d (patch)
treeb853820486a3ee7234b93bfd27b85f98b8a20dc5 /spec/javascripts
parentdc46863cda29f19a5f403ebaaded92ba17faee2f (diff)
parent13843483e886298efcf468eed14872079c53a9bf (diff)
downloadgitlab-ce-bce1c50928e4885d54dd11221a9c8197a7fb1a7d.tar.gz
Merge branch 'rs-pick-security-into-master' into 'master'
Update master with 9.5.4 security patches See merge request !14131
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/notes_spec.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js
index 8c5ad8914b0..3e791a31604 100644
--- a/spec/javascripts/notes_spec.js
+++ b/spec/javascripts/notes_spec.js
@@ -770,6 +770,20 @@ import '~/notes';
expect($tempNote.prop('nodeName')).toEqual('LI');
expect($tempNote.find('.timeline-content').hasClass('discussion')).toBeTruthy();
});
+
+ it('should return a escaped user name', () => {
+ const currentUserFullnameXSS = 'Foo <script>alert("XSS")</script>';
+ const $tempNote = this.notes.createPlaceholderNote({
+ formContent: sampleComment,
+ uniqueId,
+ isDiscussionNote: false,
+ currentUsername,
+ currentUserFullname: currentUserFullnameXSS,
+ currentUserAvatar,
+ });
+ const $tempNoteHeader = $tempNote.find('.note-header');
+ expect($tempNoteHeader.find('.hidden-xs').text().trim()).toEqual('Foo &lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;');
+ });
});
describe('createPlaceholderSystemNote', () => {