diff options
| author | Antoine Guenet <age@odoo.com> | 2019-07-11 13:20:28 +0000 |
|---|---|---|
| committer | Antoine Guenet <age@odoo.com> | 2019-07-11 14:41:12 +0000 |
| commit | e7828c362718b40ed74920a1ce3619766fa84ff2 (patch) | |
| tree | c4f28eef1283ac74126f2c8682208a78ae678567 /addons/web_editor/static/tests | |
| parent | 5b41b5c563c75e18f4cf8d2f7dd66d5e273e4341 (diff) | |
[FIX] web_editor: properly insert character in empty nested list
Fix a bug that can be reproduced like so:
- Insert list
- Type char
- ENTER
- TAB
- Type char
The character gets inserted _after_ the `br` instead of replacing it.
closes odoo/odoo#34805
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Diffstat (limited to 'addons/web_editor/static/tests')
| -rw-r--r-- | addons/web_editor/static/tests/wysiwyg_keyboard_tests.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js b/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js index e59f8d14539..861b574f9c6 100644 --- a/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js +++ b/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js @@ -811,6 +811,18 @@ var keyboardTestsChar = [{ start: "b:contents(0)->1", }, }, + { + name: "'a' in empty li", + content: '<ul><li><p><br></p></li></ul>', + steps: [{ + start: "p->1", + key: 'a', + }], + test: { + content: '<ul><li><p>a</p></li></ul>', + start: "p:contents(0)->1", + }, + }, ]; QUnit.test('Char', function (assert) { @@ -2239,6 +2251,25 @@ var keyboardTestsComplex = [{ start: "p:eq(1)->0", }, }, + // List indent + { + name: "ENTER -> TAB -> a' at end of li > p (split -> indent -> write)", + content: '<ul><li><p>a</p></li></ul>', + steps: [{ + start: "p:contents()[0]->1", + key: 'ENTER', + }, + { + key: 'TAB', + }, + { + key: 'a', + }], + test: { + content: '<ul><li><p>a</p></li><li class="o_indent"><ul><li><p>a</p></li></ul></li></ul>', + start: "p:eq(1):contents()[0]->1", + }, + }, ]; QUnit.test('Complex', function (assert) { |
