summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/chrome/action_manager_tests.js
diff options
context:
space:
mode:
authorMohammed Shekha <msh@odoo.com>2019-08-19 07:06:39 +0000
committerPierre Masereel <pim@odoo.com>2019-08-27 12:13:43 +0000
commit6952ee18bce6fa2274e1e960cec5f5f4df67ef23 (patch)
treee33b424b5a9b7690f30ffa17dc53c958d516e2a4 /addons/web/static/tests/chrome/action_manager_tests.js
parente74c6ef86a63b7d8ef50d8214b8ac48ea9f69f7e (diff)
[FIX] web: crashmanager wrong syntax of arrow function
arrow function used for error handler and error function is defined inside inner function so this will get changed, need to use self, also arrow function doesn't have its own arguments object, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions Issue raised from following commit: https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab task-2052484 closes odoo/odoo#35788 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/tests/chrome/action_manager_tests.js')
-rw-r--r--addons/web/static/tests/chrome/action_manager_tests.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/addons/web/static/tests/chrome/action_manager_tests.js b/addons/web/static/tests/chrome/action_manager_tests.js
index 26ec7b1562b..bc40fc97011 100644
--- a/addons/web/static/tests/chrome/action_manager_tests.js
+++ b/addons/web/static/tests/chrome/action_manager_tests.js
@@ -2205,6 +2205,46 @@ QUnit.module('ActionManager', {
testUtils.mock.unpatch(ReportClientAction);
});
+ QUnit.test('crashmanager service called on failed report download actions', async function (assert) {
+ assert.expect(1);
+
+ var actionManager = await createActionManager({
+ data: this.data,
+ actions: this.actions,
+ services: {
+ report: ReportService,
+ },
+ mockRPC: function (route) {
+ if (route === '/report/check_wkhtmltopdf') {
+ return Promise.resolve('ok');
+ }
+ return this._super.apply(this, arguments);
+ },
+ session: {
+ get_file: function (params) {
+ params.error({
+ data: {
+ name: 'error',
+ exception_type: 'warning',
+ arguments: ['could not download file'],
+ }
+ });
+ params.complete();
+ },
+ },
+ });
+
+ try {
+ await actionManager.doAction(11);
+ } catch (e) {
+ // e is undefined if we land here because of a rejected promise,
+ // otherwise, it is an Error, which is not what we expect
+ assert.strictEqual(e, undefined);
+ }
+
+ actionManager.destroy();
+ });
+
QUnit.module('Window Actions');
QUnit.test('can execute act_window actions from db ID', async function (assert) {