Skip to content
Snippets Groups Projects
Commit 8bceac80 authored by Xavier Morel's avatar Xavier Morel
Browse files

[IMP] web: don't check for bad dom after test on failure


Currently, if a test fails there's very high chances the DOM will not
be clean, because qunit doesn't have good cleanup APIs. This means a
test failure will always be prefixed by a dump of the page DOM which
is just confusing and makes it hard to find the actual error.

This change updates the OdooAfterTestHook handler to:

* Receive the `Test` itself, instead of adding more information to the
  synthetic object it currently receives.
* Only show the leftover DOM if the test otherwise succeeded.
* Do the entire reporting via `pushFailure`, rather than having
  duplication between an explicit `console.error` and a test failure.
* Update the QUnit.log handler to
  - not show `undefined`
  - try to improve readability by removing the bracketing and quoting

closes odoo/odoo#75939

Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
parent d26a4edf
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment