diff options
| author | Clement Ho <clemmakesapps@gmail.com> | 2017-06-14 21:46:36 +0000 |
|---|---|---|
| committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-16 11:52:56 -0500 |
| commit | 245900e6c467222fd5d500e03d8bcf6f3e34e16a (patch) | |
| tree | ff0d1103bcbcd91460b9d7d3fee164c14f1a695c | |
| parent | 563a8df70cdeb16f7c88e13c6862a47ea0f57e8f (diff) | |
| download | gitlab-ce-245900e6c467222fd5d500e03d8bcf6f3e34e16a.tar.gz | |
Merge branch '33529-fix-autocomplete-atwho-not-showing-on-note-edit-form' into 'master'
Fix autocomplete not working on note edit form
Closes #33529
See merge request !12106
| -rw-r--r-- | app/assets/javascripts/notes.js | 2 | ||||
| -rw-r--r-- | spec/javascripts/notes_spec.js | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 8bdbbe6612f..35d16b298a6 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -1060,7 +1060,7 @@ const normalizeNewlines = function(str) { var targetId = $originalContentEl.data('target-id'); var targetType = $originalContentEl.data('target-type'); - new gl.GLForm($editForm.find('form')); + new gl.GLForm($editForm.find('form'), this.enableGFM); $editForm.find('form') .attr('action', postUrl) diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js index bfd8b8648a6..665c32d3f23 100644 --- a/spec/javascripts/notes_spec.js +++ b/spec/javascripts/notes_spec.js @@ -378,6 +378,23 @@ import '~/notes'; }); }); + describe('putEditFormInPlace', () => { + it('should call gl.GLForm with GFM parameter passed through', () => { + spyOn(gl, 'GLForm'); + + const $el = jasmine.createSpyObj('$form', ['find', 'closest']); + $el.find.and.returnValue($('<div>')); + $el.closest.and.returnValue($('<div>')); + + Notes.prototype.putEditFormInPlace.call({ + getEditFormSelector: () => '', + enableGFM: true + }, $el); + + expect(gl.GLForm).toHaveBeenCalledWith(jasmine.any(Object), true); + }); + }); + describe('postComment & updateComment', () => { const sampleComment = 'foo'; const updatedComment = 'bar'; |
