summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes_spec.js
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-06-12 13:42:31 -0500
committerEric Eastwood <contact@ericeastwood.com>2017-06-14 11:55:34 -0500
commit4182e3fa635a0d83d101d27da39d9efae3d5b1c7 (patch)
tree33089bf580f9baff44d6a9910032ef25d37046f1 /spec/javascripts/notes_spec.js
parent64e85fdaffcd03ef52ff74953b1a4e0caf5a23e8 (diff)
downloadgitlab-ce-4182e3fa635a0d83d101d27da39d9efae3d5b1c7.tar.gz
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
Diffstat (limited to 'spec/javascripts/notes_spec.js')
-rw-r--r--spec/javascripts/notes_spec.js17
1 files changed, 17 insertions, 0 deletions
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';