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
This commit is contained in:
Eric Eastwood 2017-06-12 13:42:31 -05:00
parent 64e85fdaff
commit 4182e3fa63
2 changed files with 18 additions and 1 deletions

View File

@ -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)

View File

@ -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';