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) {