mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:01:14 +08:00
Better behavior When inserting a link with no description
This commit is contained in:
@ -183,13 +183,16 @@ testCase('link modal (cancel)', function(assert) {
|
||||
});
|
||||
});
|
||||
|
||||
testCase('link modal (simple link)', function(assert) {
|
||||
testCase('link modal (simple link)', function(assert, textarea) {
|
||||
click('button.link');
|
||||
fillIn('.insert-link input', 'http://eviltrout.com');
|
||||
click('.insert-link button.btn-primary');
|
||||
const desc = I18n.t('composer.link_description');
|
||||
andThen(() => {
|
||||
assert.equal(this.$('.insert-link.hidden').length, 1);
|
||||
assert.equal(this.get('value'), 'hello world.[http://eviltrout.com](http://eviltrout.com)');
|
||||
assert.equal(this.get('value'), `hello world.[${desc}](http://eviltrout.com)`);
|
||||
assert.equal(textarea.selectionStart, 13);
|
||||
assert.equal(textarea.selectionEnd, 13 + desc.length);
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user