diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/frontend/gl_form_spec.js | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/frontend/gl_form_spec.js')
-rw-r--r-- | spec/frontend/gl_form_spec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/frontend/gl_form_spec.js b/spec/frontend/gl_form_spec.js index 150d8a053d5..52e1693f8a6 100644 --- a/spec/frontend/gl_form_spec.js +++ b/spec/frontend/gl_form_spec.js @@ -9,6 +9,8 @@ describe('GLForm', () => { describe('when instantiated', () => { beforeEach(done => { + window.gl = window.gl || {}; + testContext.form = $('<form class="gfm-form"><textarea class="js-gfm-input"></form>'); testContext.textarea = testContext.form.find('textarea'); jest.spyOn($.prototype, 'off').mockReturnValue(testContext.textarea); @@ -111,5 +113,21 @@ describe('GLForm', () => { expect(autosize.destroy).not.toHaveBeenCalled(); }); }); + + describe('supportsQuickActions', () => { + it('should return false if textarea does not support quick actions', () => { + const glForm = new GLForm(testContext.form, false); + + expect(glForm.supportsQuickActions).toEqual(false); + }); + + it('should return true if textarea supports quick actions', () => { + testContext.textarea.attr('data-supports-quick-actions', true); + + const glForm = new GLForm(testContext.form, false); + + expect(glForm.supportsQuickActions).toEqual(true); + }); + }); }); }); |