From 4182e3fa635a0d83d101d27da39d9efae3d5b1c7 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 12 Jun 2017 13:42:31 -0500 Subject: Fix autocomplete not working on note edit form Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/33529 Bug introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11278 --- spec/javascripts/notes_spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'spec/javascripts/notes_spec.js') 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($('
')); + $el.closest.and.returnValue($('
')); + + 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'; -- cgit v1.2.1