diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2017-09-11 14:13:54 -0400 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2017-10-19 13:31:51 -0400 |
commit | 1d30e5e96434a0b9506baeda29680f347be11556 (patch) | |
tree | a591e802f4ec2a43d3dcf655e984026beadcb0c1 /spec/javascripts/notes_spec.js | |
parent | d0630ed38d9b7afa9f7099016507756ea5e77edf (diff) | |
download | gitlab-ce-1d30e5e96434a0b9506baeda29680f347be11556.tar.gz |
notes.js: use the original content when resetting the form
Otherwise, when an error occurred, the content was escaped and
re-escaped on every error.
Fixes #37724
Diffstat (limited to 'spec/javascripts/notes_spec.js')
-rw-r--r-- | spec/javascripts/notes_spec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js index 66c52611614..4546b88e44d 100644 --- a/spec/javascripts/notes_spec.js +++ b/spec/javascripts/notes_spec.js @@ -103,6 +103,16 @@ import '~/notes'; $('.js-comment-button').click(); expect(this.autoSizeSpy).toHaveBeenTriggered(); }); + + it('should not place escaped text in the comment box in case of error', function() { + const deferred = $.Deferred(); + spyOn($, 'ajax').and.returnValue(deferred.promise()); + $(textarea).text('A comment with `markup`.'); + + deferred.reject(); + $('.js-comment-button').click(); + expect($(textarea).val()).toEqual('A comment with `markup`.'); + }); }); describe('updateNote', () => { |