diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-10 10:47:29 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-11 08:41:33 +0100 |
commit | 556ef5ed9f4700a614980bc9aa24c4b45c7efb08 (patch) | |
tree | 29ad76973e6a60185d149b436bd2cc5128b6c0e5 /spec/javascripts/notes_spec.js | |
parent | 44d3745e51c7433d2560cdd82c9df9653d3577a3 (diff) | |
download | gitlab-ce-556ef5ed9f4700a614980bc9aa24c4b45c7efb08.tar.gz |
spec fixesph-gl-form-js-modules
Diffstat (limited to 'spec/javascripts/notes_spec.js')
-rw-r--r-- | spec/javascripts/notes_spec.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js index 65d2e8fd9fb..709f70c2f03 100644 --- a/spec/javascripts/notes_spec.js +++ b/spec/javascripts/notes_spec.js @@ -426,19 +426,17 @@ import '~/notes'; }); describe('putEditFormInPlace', () => { - it('should call gl.GLForm with GFM parameter passed through', () => { - spyOn(gl, 'GLForm'); + it('should call GLForm with GFM parameter passed through', () => { + const notes = new Notes('', []); + const $el = $(` + <div> + <form></form> + </div> + `); - const $el = jasmine.createSpyObj('$form', ['find', 'closest']); - $el.find.and.returnValue($('<div>')); - $el.closest.and.returnValue($('<div>')); + notes.putEditFormInPlace($el); - Notes.prototype.putEditFormInPlace.call({ - getEditFormSelector: () => '', - enableGFM: true - }, $el); - - expect(gl.GLForm).toHaveBeenCalledWith(jasmine.any(Object), true); + expect(notes.glForm.enableGFM).toBeTruthy(); }); }); |