[FIX] web,mail: fix wrong assertions in tests

This is not a big deal, but by passing a widget instance or a DOM
node as message to a QUnit.assert function, QUnit keeps a reference
to that instance or DOM element, and it can never be garbage
collected (nor its bound handlers in the case of a DOM element).

For the mail case, this was a bit more critical as we didn't check
what the author of the test actually wanted to check.

closes odoo/odoo#83384

X-original-commit: 692fd6ecee602f7ceaae093b855aff65d50ca797
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Aaron Bohy
2022-01-26 08:49:09 +00:00
parent 4fd62d2639
commit ca28cff17d
2 changed files with 2 additions and 2 deletions
@@ -161,7 +161,7 @@ QUnit.test('chat window new message: focused on open [REQUIRE FOCUS]', async fun
document.querySelector(`.o_ChatWindow`).classList.contains('o-focused'),
"chat window should be focused"
);
assert.ok(
assert.strictEqual(
document.activeElement,
document.querySelector(`.o_ChatWindow_newMessageFormInput`),
"chat window focused = selection input focused"
@@ -1933,7 +1933,7 @@ QUnit.module('Views', {
res_id: 1,
});
assert.containsOnce(form, 'span.o_required_modifier', form);
assert.containsOnce(form, 'span.o_required_modifier');
await testUtils.form.clickEdit(form);
assert.containsOnce(form, 'input.o_required_modifier',