From 8a1cb4758df385a75c759e04a9d7ae79b712ad85 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 31 Jan 2018 19:43:51 +0100 Subject: [PATCH] [FIX] web_editor: avoid useless 404 during test removeSrcAttribute should avoid these rpc, but for some unknown reasons, on firefox it works but not with chrome. Because the purpose of the test is to check the url and not the content, that works to use an existing route. Courtesy of @kangol for the fix --- .../web_editor/static/tests/web_editor_tests.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/web_editor/static/tests/web_editor_tests.js b/addons/web_editor/static/tests/web_editor_tests.js index 3f46edde64c..2ea6078c44b 100644 --- a/addons/web_editor/static/tests/web_editor_tests.js +++ b/addons/web_editor/static/tests/web_editor_tests.js @@ -136,12 +136,12 @@ QUnit.test('field html_frame widget', function (assert) { model: 'mass.mailing', data: this.data, arch: '
' + - '' + + '' + '', res_id: 1, session: {user_context: {lang: "en_us"}}, mockRPC: function (route) { - if (_.str.startsWith(route, '/test')) { + if (_.str.startsWith(route, '/logo')) { // those tests will be executed twice, once in readonly and once in edit assert.ok(route.search('model=mass.mailing') > 0, "the route should specify the correct model"); @@ -200,7 +200,7 @@ QUnit.test('html_frame does not crash when saving in readonly', function (assert data: this.data, arch: '
' + '' + - '' + + '' + '' + '
', res_id: 1, @@ -208,7 +208,7 @@ QUnit.test('html_frame does not crash when saving in readonly', function (assert if (args.method) { assert.step(args.method); } - if (_.str.startsWith(route, '/test')) { + if (_.str.startsWith(route, '/logo')) { // manually call the callback to simulate that the iframe has // been loaded (note: just the content, not the editor) window.odoo[$.deparam(route).callback + '_content'].call(); @@ -237,7 +237,7 @@ QUnit.test('html_frame does not crash when saving in edit mode (editor not loade arch: '
' + '' + '' + - '' + + '' + '' + '
', res_id: 1, @@ -245,7 +245,7 @@ QUnit.test('html_frame does not crash when saving in edit mode (editor not loade if (args.method) { assert.step(args.method); } - if (_.str.startsWith(route, '/test')) { + if (_.str.startsWith(route, '/logo')) { // manually call the callback to simulate that the iframe has // been partially loaded (just the content, not the editor) window.odoo[$.deparam(route).callback + '_content'](); @@ -279,7 +279,7 @@ QUnit.test('html_frame saving in edit mode (editor and content fully loaded)', f arch: '
' + '' + '' + - '' + + '' + '' + '
', res_id: 1, @@ -290,7 +290,7 @@ QUnit.test('html_frame saving in edit mode (editor and content fully loaded)', f writeDeferred.resolve(); } } - if (_.str.startsWith(route, '/test')) { + if (_.str.startsWith(route, '/logo')) { // manually call the callback to simulate that the iframe has // been fully loaded (content + editor) var callback = $.deparam(route).callback;