FIX: After uploading an image the selection was not in the correct spot

This commit is contained in:
Robin Ward
2016-07-25 15:31:21 -04:00
parent 215eae9972
commit 3200d836f7
3 changed files with 29 additions and 6 deletions

View File

@ -596,3 +596,18 @@ componentTest('emoji', {
});
}
});
testCase("replace-text event", function(assert, textarea) {
this.set('value', "red green blue");
andThen(() => {
this.container.lookup('app-events:main').trigger('composer:replace-text', 'green', 'yellow');
});
andThen(() => {
assert.equal(this.get('value'), 'red yellow blue');
assert.equal(textarea.selectionStart, 10);
assert.equal(textarea.selectionEnd, 10);
});
});