[FIX] web: prevent false test fail
The commit [1] removed two async module and caused a reorganisation on the module loading. Since that commit, two tests that throw an error failed because the error message was written in the console and the server considered this as a test fail. Now, the error message is not written in the console anymore. [1]: 96687f29496ab4cf16ae2ab1584ef1a6a3fb4a11 Part-of: odoo/odoo#121185
This commit is contained in:
@@ -13041,6 +13041,13 @@ QUnit.module("Views", (hooks) => {
|
||||
QUnit.test(
|
||||
"coming to an action with an error from a form view with a dirty x2m",
|
||||
async function (assert) {
|
||||
const handler = (ev) => {
|
||||
// need to preventDefault to remove error from console (so python test pass)
|
||||
ev.preventDefault();
|
||||
};
|
||||
window.addEventListener("unhandledrejection", handler);
|
||||
registerCleanup(() => window.removeEventListener("unhandledrejection", handler));
|
||||
|
||||
class TestClientAction extends Component {
|
||||
setup() {
|
||||
throw new Error("Something went wrong");
|
||||
@@ -13124,6 +13131,13 @@ QUnit.module("Views", (hooks) => {
|
||||
QUnit.test(
|
||||
"coming to an action with an error from a form view with a record in creation",
|
||||
async function (assert) {
|
||||
const handler = (ev) => {
|
||||
// need to preventDefault to remove error from console (so python test pass)
|
||||
ev.preventDefault();
|
||||
};
|
||||
window.addEventListener("unhandledrejection", handler);
|
||||
registerCleanup(() => window.removeEventListener("unhandledrejection", handler));
|
||||
|
||||
class TestClientAction extends Component {
|
||||
setup() {
|
||||
throw new Error("Something went wrong");
|
||||
|
||||
Reference in New Issue
Block a user