diff options
| author | Antoine Guenet <age@odoo.com> | 2019-02-07 10:20:57 +0000 |
|---|---|---|
| committer | Antoine Guenet <age@odoo.com> | 2019-02-07 10:20:57 +0000 |
| commit | eea58a3cf85b08e58c8b2f755fca933af171d1f7 (patch) | |
| tree | 9cee0765396baf11dec58d87066199f6eee14eee /addons/web_editor/static/tests | |
| parent | b1fadbc6c61b9dde0ecbe1c798db7d7416091515 (diff) | |
[FIX] web_editor: on anchor split, rerange and clean data on getValue
Due to a wrong order of operations, after splitting an anchor (press
ENTER), the range was setting on the first anchor. Now it sets on the
second one (as the code - but not the tests - suggests was supposed to
happen). Tests were adapted to reflect that change.
In tests, after splitting the anchor, `Wysiwyg.getValue` didn't always
properly clean up `data-original-title`. Targetting empty
`data-original-title` attribute instead of `aria-describedby` attribute
should fix that issue.
closes odoo/odoo#30923
Diffstat (limited to 'addons/web_editor/static/tests')
| -rw-r--r-- | addons/web_editor/static/tests/wysiwyg_keyboard_tests.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js b/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js index 37727c691bd..14f06ec2e9d 100644 --- a/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js +++ b/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js @@ -1665,9 +1665,9 @@ var keyboardTestsEnter = [{ key: 'a', }], test: { - content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">​a​</a><a class=\"btn\" href=\"#\">dom to edit</a></div>", + content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">Label</a><a class=\"btn\" href=\"#\">​adom to edit​</a></div>", // split button has no text so the placeholder text is selected then replaced by 'a' - start: "a:contents()[0]->2", + start: "a:eq(1):contents()[0]->2", }, }, { @@ -1680,9 +1680,9 @@ var keyboardTestsEnter = [{ key: 'a', }], test: { - content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">​a​</a><a class=\"btn\" href=\"#\">dom to edit</a></div>", + content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">Label</a><a class=\"btn\" href=\"#\">​adom to edit​</a></div>", // split button has no text so the placeholder text is selected then replaced by 'a' - start: "a:contents()[0]->2", + start: "a:eq(1):contents()[0]->2", }, }, { @@ -1767,9 +1767,9 @@ var keyboardTestsEnter = [{ key: 'a', }], test: { - content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">​a​</a><a class=\"btn\" href=\"#\">Label</a></div>", + content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">Label</a><a class=\"btn\" href=\"#\">​a​</a></div>", // Removing all text in a link replaces that text with "Label" - start: "a:contents()[0]->2", + start: "a:eq(1):contents()[0]->2", }, }, { @@ -1781,9 +1781,8 @@ var keyboardTestsEnter = [{ key: 'ENTER', }], test: { - content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">​Label​</a><a class=\"btn\" href=\"#\">ot to edit</a></div>", - start: "a:contents()[0]->1", - end: "a:contents()[0]->6", + content: "<div class=\"unbreakable\"><a class=\"btn\" href=\"#\">Label</a><a class=\"btn\" href=\"#\">​ot to edit​</a></div>", + start: "a:eq(1):contents()[0]->1", }, }, ]; |
