Refactor code; add tests

This commit is contained in:
scossar
2018-01-29 17:42:19 -08:00
parent 42970e758e
commit 41f1e7430c
7 changed files with 89 additions and 11 deletions

View File

@ -715,6 +715,26 @@ testCase(`list button with line sequence`, function(assert, textarea) {
});
});
componentTest('clicking the toggle-direction button toggles the direction', {
template: '{{d-editor value=value}}',
beforeEach() {
this.siteSettings.support_mixed_text_direction = true;
this.siteSettings.default_locale = "en";
},
test(assert) {
const textarea = this.$('textarea.d-editor-input');
click('button.toggle-direction');
andThen(() => {
assert.equal(textarea.attr('dir'), 'rtl');
});
click('button.toggle-direction');
andThen(() => {
assert.equal(textarea.attr('dir'), 'ltr');
});
}
});
testCase(`doesn't jump to bottom with long text`, function(assert, textarea) {
let longText = 'hello world.';