mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:41:24 +08:00
FIX: Empty lines should be selected for block quotes
This commit is contained in:
@ -514,6 +514,32 @@ third line`
|
||||
});
|
||||
|
||||
|
||||
componentTest("quote button - empty lines", {
|
||||
template: '{{d-editor value=value composerEvents=true}}',
|
||||
beforeEach() {
|
||||
this.set('value', "one\n\ntwo\n\nthree");
|
||||
},
|
||||
test(assert) {
|
||||
const textarea = jumpEnd(this.$('textarea.d-editor-input')[0]);
|
||||
|
||||
andThen(() => {
|
||||
textarea.selectionStart = 0;
|
||||
});
|
||||
|
||||
click('button.quote');
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), "> one\n> \n> two\n> \n> three");
|
||||
assert.equal(textarea.selectionStart, 0);
|
||||
assert.equal(textarea.selectionEnd, 25);
|
||||
});
|
||||
|
||||
click('button.quote');
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), "one\n\ntwo\n\nthree");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
testCase('quote button', function(assert, textarea) {
|
||||
|
||||
andThen(() => {
|
||||
|
Reference in New Issue
Block a user