summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes_spec.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-25 11:13:28 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-05-25 14:34:04 +0100
commit51df3b95d30b0e8f72c7d69a4bd51c3dac77b689 (patch)
treef4bfd28326f71cf4a6679b9617aed955dd621de0 /spec/javascripts/notes_spec.js
parentc64cd41e35bff61713f3d55834d14cdca715468f (diff)
downloadgitlab-ce-32908-edit-comment.tar.gz
[ci skip] Adds changelog entry32908-edit-comment
Diffstat (limited to 'spec/javascripts/notes_spec.js')
-rw-r--r--spec/javascripts/notes_spec.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js
index ccd703b5b4b..025f08ee332 100644
--- a/spec/javascripts/notes_spec.js
+++ b/spec/javascripts/notes_spec.js
@@ -443,45 +443,6 @@ import '~/notes';
});
});
- describe('update comment with script tags', () => {
- const sampleComment = '<script></script>';
- const updatedComment = '<script></script>';
- const note = {
- id: 1234,
- html: `<li class="note note-row-1234 timeline-entry" id="note_1234">
- <div class="note-text">${sampleComment}</div>
- </li>`,
- note: sampleComment,
- valid: true
- };
- let $form;
- let $notesContainer;
-
- beforeEach(() => {
- this.notes = new Notes('', []);
- window.gon.current_username = 'root';
- window.gon.current_user_fullname = 'Administrator';
- $form = $('form.js-main-target-form');
- $notesContainer = $('ul.main-notes-list');
- $form.find('textarea.js-note-text').html(sampleComment);
- });
-
- it('should not render a script tag', () => {
- const deferred = $.Deferred();
- spyOn($, 'ajax').and.returnValue(deferred.promise());
- $('.js-comment-button').click();
-
- deferred.resolve(note);
- const $noteEl = $notesContainer.find(`#note_${note.id}`);
- $noteEl.find('.js-note-edit').click();
- $noteEl.find('textarea.js-note-text').html(updatedComment);
- $noteEl.find('.js-comment-save-button').click();
-
- const $updatedNoteEl = $notesContainer.find(`#note_${note.id}`).find('.js-task-list-container');
- expect($updatedNoteEl.find('.note-text').text().trim()).toEqual('');
- });
- });
-
describe('getFormData', () => {
it('should return form metadata object from form reference', () => {
this.notes = new Notes('', []);