Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 09:09:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 09:09:05 +0300
commit8c9dc985b90c353b33cb829caf51f8320171bc15 (patch)
tree9a68886dbea1aefabddb46bbd3faf961eab22ae6 /spec/javascripts
parent500626a5c953ad81cfc3ed74bf0148c075617e58 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/behaviors/shortcuts/shortcuts_issuable_spec.js14
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();
+ });
+ });
+ });
});
});