Merge pull request #3891 from cpradio/fix-selected-link-text

FIX: Use selected text in the link if text is already selected, otherwise, put the URL
This commit is contained in:
Robin Ward
2015-11-09 16:24:07 -05:00
2 changed files with 15 additions and 1 deletions

View File

@@ -193,6 +193,19 @@ testCase('link modal (simple link)', function(assert) {
});
});
testCase('link modal (simple link) with selected text', function(assert, textarea) {
textarea.selectionStart = 0;
textarea.selectionEnd = 12;
click('button.link');
fillIn('.insert-link input', 'http://eviltrout.com');
click('.insert-link button.btn-primary');
andThen(() => {
assert.equal(this.$('.insert-link.hidden').length, 1);
assert.equal(this.get('value'), '[hello world.](http://eviltrout.com)');
});
});
testCase('link modal (link with description)', function(assert) {
click('button.link');
fillIn('.insert-link input', 'http://eviltrout.com "evil trout"');