diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 11:18:50 +0000 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/javascripts/shortcuts_spec.js | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) | |
download | gitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/javascripts/shortcuts_spec.js')
-rw-r--r-- | spec/javascripts/shortcuts_spec.js | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/spec/javascripts/shortcuts_spec.js b/spec/javascripts/shortcuts_spec.js deleted file mode 100644 index df7012bb659..00000000000 --- a/spec/javascripts/shortcuts_spec.js +++ /dev/null @@ -1,46 +0,0 @@ -import $ from 'jquery'; -import Shortcuts from '~/behaviors/shortcuts/shortcuts'; - -describe('Shortcuts', () => { - const fixtureName = 'snippets/show.html'; - const createEvent = (type, target) => - $.Event(type, { - target, - }); - - preloadFixtures(fixtureName); - - describe('toggleMarkdownPreview', () => { - beforeEach(() => { - loadFixtures(fixtureName); - - spyOnEvent('.js-new-note-form .js-md-preview-button', 'focus'); - spyOnEvent('.edit-note .js-md-preview-button', 'focus'); - - new Shortcuts(); // eslint-disable-line no-new - }); - - it('focuses preview button in form', () => { - Shortcuts.toggleMarkdownPreview( - createEvent('KeyboardEvent', document.querySelector('.js-new-note-form .js-note-text')), - ); - - expect('focus').toHaveBeenTriggeredOn('.js-new-note-form .js-md-preview-button'); - }); - - it('focues preview button inside edit comment form', done => { - document.querySelector('.js-note-edit').click(); - - setTimeout(() => { - Shortcuts.toggleMarkdownPreview( - createEvent('KeyboardEvent', document.querySelector('.edit-note .js-note-text')), - ); - - expect('focus').not.toHaveBeenTriggeredOn('.js-new-note-form .js-md-preview-button'); - expect('focus').toHaveBeenTriggeredOn('.edit-note .js-md-preview-button'); - - done(); - }); - }); - }); -}); |