[FIX] web: make test more robust
Before this commit, the changed test sometimes failed on runbot (rarely though), because it might happen that the debounce released before the promise returned by the click helper resolved (e.g. if the server was overloaded, or was garbage collecting...). That promise waited for a setTimeout, and then for a nextAnimationFrame. In this scenario, there's no need to wait so long, as there is no rendering to wait for. Example of failing build: https://runbot.odoo.com/runbot/build/10360554 X-original-commit: 880c4683698c987f212e4a113b374230566001f1 Part-of: odoo/odoo#78698
This commit is contained in:
@@ -5512,10 +5512,12 @@ QUnit.module('Views', {
|
||||
count++;
|
||||
event.data.on_closed();
|
||||
});
|
||||
await testUtils.dom.click($('button[data-name="a1"]').first());
|
||||
testUtils.dom.click($('button[data-name="a1"]').first());
|
||||
await new Promise(r => setTimeout(r));
|
||||
assert.strictEqual(count, 1, "should have triggered a execute action");
|
||||
|
||||
await testUtils.dom.click($('button[data-name="a1"]').first());
|
||||
testUtils.dom.click($('button[data-name="a1"]').first());
|
||||
await new Promise(r => setTimeout(r));
|
||||
assert.strictEqual(count, 1, "double-click on kanban actions should be debounced");
|
||||
|
||||
assert.verifySteps([
|
||||
|
||||
Reference in New Issue
Block a user