From 4339101afe090330b491d6f9f89ef9d787716d1c Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Thu, 21 Feb 2019 09:11:02 +0000 Subject: [PATCH] [IMP] web_editor: add tests for deleting all contents of format block Implementing new behavior on delete all contents of a format block revealed insufficient testing, which is now covered. closes odoo/odoo#31277 --- .../static/tests/wysiwyg_keyboard_tests.js | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js b/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js index e8696a802c5..56ceb27a025 100644 --- a/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js +++ b/addons/web_editor/static/tests/wysiwyg_keyboard_tests.js @@ -3110,6 +3110,55 @@ var keyboardTestsBackspace = [{ start: "p:eq(1):contents()[0]->1", }, }, + { + name: "in h1: BACKSPACE on full selection -> 'a'", + content: '

dom to delete

', + steps: [{ + start: 'h1:contents()[0]->0', + end: 'h1:contents()[0]->13', + key: 'BACKSPACE', + }, { + key: 'a', + }], + test: { + content: '

a

', + start: "h1:contents()[0]->1", + }, + }, + { + name: "in h1: BACKSPACE on full selection -> BACKSPACE -> 'a'", + content: '

dom to delete

', + steps: [{ + start: 'h1:contents()[0]->0', + end: 'h1:contents()[0]->13', + key: 'BACKSPACE', + }, { + key: 'BACKSPACE', + }, { + key: 'a', + }], + test: { + content: '

a

', + start: "p:contents()[0]->1", + }, + }, + { + name: "in h1: BACKSPACE on full selection -> DELETE -> 'a'", + content: '

dom to delete

', + steps: [{ + start: 'h1:contents()[0]->0', + end: 'h1:contents()[0]->13', + key: 'BACKSPACE', + }, { + key: 'DELETE', + }, { + key: 'a', + }], + test: { + content: '

a

', + start: "h1:contents()[0]->1", + }, + }, // merging non-similar blocks