FIX: Improve windows double clicking on words in editor

This commit is contained in:
Robin Ward
2015-11-24 13:41:56 -05:00
parent 99c1aa2e85
commit 49bda0b17d
2 changed files with 25 additions and 9 deletions

View File

@ -62,6 +62,18 @@ function testCase(title, testFunc) {
});
}
testCase(`selecting the space after a word`, function(assert, textarea) {
textarea.selectionStart = 0;
textarea.selectionEnd = 6;
click(`button.bold`);
andThen(() => {
assert.equal(this.get('value'), `**hello** world.`);
assert.equal(textarea.selectionStart, 2);
assert.equal(textarea.selectionEnd, 7);
});
});
testCase(`bold button with no selection`, function(assert, textarea) {
click(`button.bold`);
andThen(() => {
@ -231,10 +243,8 @@ componentTest('advanced code', {
test(assert) {
const textarea = this.$('textarea.d-editor-input')[0];
andThen(() => {
textarea.selectionStart = 0;
textarea.selectionEnd = textarea.value.length;
});
textarea.selectionStart = 0;
textarea.selectionEnd = textarea.value.length;
click('button.code');
andThen(() => {