From 7c04deef5e66134276a17e78b4bb74e23e200b97 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 9 Mar 2017 09:57:57 +0100 Subject: [PATCH] [IMP] web: test_utils: catch iframe src Trigger an RPC with the corresponding route so that the arguments specified into the route can be tested. --- addons/web/static/test/helpers/test_utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/web/static/test/helpers/test_utils.js b/addons/web/static/test/helpers/test_utils.js index 5f08ff67fe3..28fce6140c3 100644 --- a/addons/web/static/test/helpers/test_utils.js +++ b/addons/web/static/test/helpers/test_utils.js @@ -132,9 +132,9 @@ function createAsyncView(params) { var view = new params.View(fields_view.arch, fields_view.fields, viewOptions); - // remove src attribute on images to remove not found error in tests - function removeImageSrc () { - $('img', this).each(function () { + // remove src attribute on images and iframes to remove not found error in tests + function removeSrcAttribute () { + $('img, iframe[src]', this).each(function () { var src = $(this).attr('src'); if (src[0] !== '#') { $(this).attr('src', '#test:' + $(this).attr('src')); @@ -142,7 +142,7 @@ function createAsyncView(params) { } }); } - $('#qunit-fixture').on('DOMNodeInserted', removeImageSrc); + $('#qunit-fixture').on('DOMNodeInserted', removeSrcAttribute); if (params.with_modifiers) { _.each(params.with_modifiers, function (modifier, name) { @@ -170,7 +170,7 @@ function createAsyncView(params) { // when it will be called the second time (by its parent) delete view.destroy; widget.destroy(); - $('#qunit-fixture').off('DOMNodeInserted', removeImageSrc); + $('#qunit-fixture').off('DOMNodeInserted', removeSrcAttribute); }; return view.appendTo($view_manager).then(function () { view.$el.on('click', 'a', function (ev) {