diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 09:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 09:09:05 +0300 |
commit | 8c9dc985b90c353b33cb829caf51f8320171bc15 (patch) | |
tree | 9a68886dbea1aefabddb46bbd3faf961eab22ae6 /spec/javascripts/behaviors | |
parent | 500626a5c953ad81cfc3ed74bf0148c075617e58 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/behaviors')
-rw-r--r-- | spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js b/spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js index 5e457a4e823..f6232026915 100644 --- a/spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js +++ b/spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js @@ -52,6 +52,7 @@ describe('ShortcutsIssuable', function() { return documentFragment; }); }; + describe('with empty selection', () => { it('does not return an error', () => { ShortcutsIssuable.replyWithSelectedText(true); @@ -297,5 +298,18 @@ describe('ShortcutsIssuable', function() { }); }); }); + + describe('with a valid selection with no text content', () => { + it('returns the proper markdown', done => { + stubSelection('<img src="foo" alt="image" />'); + ShortcutsIssuable.replyWithSelectedText(true); + + setTimeout(() => { + expect($(FORM_SELECTOR).val()).toBe('> ![image](http://localhost:9876/foo)\n\n'); + + done(); + }); + }); + }); }); }); |