[FIX] mail:tests: "Timeout: the render didn't stop."

These tests assert that some user interactions didn't do something.
The user interactions were mistakenly expecting to trigger some
re-render.

Task-2333810

closes odoo/odoo#57091

X-original-commit: b4c4086104d815442ff6f2e92f80513f2ffad5ab
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Alexandre Kühn
2020-09-04 12:08:18 +00:00
parent 73143b5e70
commit f20adc19d2
2 changed files with 11 additions and 12 deletions
@@ -9,6 +9,7 @@ const {
afterNextRender,
beforeEach,
createRootComponent,
nextAnimationFrame,
start,
} = require('mail/static/src/utils/test_utils.js');
@@ -436,10 +437,9 @@ QUnit.test('do not post message with "Enter" keyboard shortcut', async function
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
document.execCommand('insertText', false, "Test");
});
await afterNextRender(() => {
const kevt = new window.KeyboardEvent('keydown', { key: "Enter" });
document.querySelector('.o_ComposerTextInput_textarea').dispatchEvent(kevt);
});
const kevt = new window.KeyboardEvent('keydown', { key: "Enter" });
document.querySelector('.o_ComposerTextInput_textarea').dispatchEvent(kevt);
await nextAnimationFrame();
assert.containsNone(
document.body,
'.o_Message',
@@ -7,6 +7,7 @@ const {
afterEach,
afterNextRender,
beforeEach,
nextAnimationFrame,
start,
} = require('mail/static/src/utils/test_utils.js');
@@ -2950,10 +2951,9 @@ QUnit.test('do not post message on non-mailing channel with "SHIFT-Enter" keyboa
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
document.execCommand('insertText', false, "Test");
});
await afterNextRender(() => {
const kevt = new window.KeyboardEvent('keydown', { key: "Enter", shiftKey: true });
document.querySelector('.o_ComposerTextInput_textarea').dispatchEvent(kevt);
});
const kevt = new window.KeyboardEvent('keydown', { key: "Enter", shiftKey: true });
document.querySelector('.o_ComposerTextInput_textarea').dispatchEvent(kevt);
await nextAnimationFrame();
assert.containsNone(
document.body,
'.o_Message',
@@ -3058,10 +3058,9 @@ QUnit.test('do not post message on mailing channel with "Enter" keyboard shortcu
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
document.execCommand('insertText', false, "Test");
});
await afterNextRender(() => {
const kevt = new window.KeyboardEvent('keydown', { key: "Enter" });
document.querySelector('.o_ComposerTextInput_textarea').dispatchEvent(kevt);
});
const kevt = new window.KeyboardEvent('keydown', { key: "Enter" });
document.querySelector('.o_ComposerTextInput_textarea').dispatchEvent(kevt);
await nextAnimationFrame();
assert.containsNone(
document.body,
'.o_Message',