mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:21:25 +08:00
UX: remove 🔥heading and ruler button from composer toolbar
This commit is contained in:
@ -692,66 +692,6 @@ testCase(`list button with line sequence`, function(assert, textarea) {
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`heading button with no selection`, function(assert, textarea) {
|
||||
const example = I18n.t('composer.heading_text');
|
||||
|
||||
click(`button.heading`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n## ${example}`);
|
||||
assert.equal(textarea.selectionStart, 14);
|
||||
assert.equal(textarea.selectionEnd, 17 + example.length);
|
||||
});
|
||||
|
||||
textarea.selectionStart = 30;
|
||||
textarea.selectionEnd = 30;
|
||||
click(`button.heading`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n${example}`);
|
||||
assert.equal(textarea.selectionStart, 14);
|
||||
assert.equal(textarea.selectionEnd, 14 + example.length);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`rule between things`, function(assert, textarea) {
|
||||
textarea.selectionStart = 5;
|
||||
textarea.selectionEnd = 5;
|
||||
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello\n\n----------\n world.`);
|
||||
assert.equal(textarea.selectionStart, 18);
|
||||
assert.equal(textarea.selectionEnd, 18);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`rule with no selection`, function(assert, textarea) {
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n----------\n`);
|
||||
assert.equal(textarea.selectionStart, 25);
|
||||
assert.equal(textarea.selectionEnd, 25);
|
||||
});
|
||||
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello world.\n\n----------\n\n\n----------\n`);
|
||||
assert.equal(textarea.selectionStart, 38);
|
||||
assert.equal(textarea.selectionEnd, 38);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`rule with a selection`, function(assert, textarea) {
|
||||
textarea.selectionStart = 6;
|
||||
textarea.selectionEnd = 11;
|
||||
|
||||
click(`button.rule`);
|
||||
andThen(() => {
|
||||
assert.equal(this.get('value'), `hello \n\n----------\n.`);
|
||||
assert.equal(textarea.selectionStart, 19);
|
||||
assert.equal(textarea.selectionEnd, 19);
|
||||
});
|
||||
});
|
||||
|
||||
testCase(`doesn't jump to bottom with long text`, function(assert, textarea) {
|
||||
|
||||
let longText = 'hello world.';
|
||||
|
Reference in New Issue
Block a user