diff options
| author | Jeremy Kersten <jke@odoo.com> | 2018-01-31 19:43:51 +0100 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2018-02-01 14:13:32 +0100 |
| commit | 8a1cb4758df385a75c759e04a9d7ae79b712ad85 (patch) | |
| tree | a8946a439cb98f70666fa96077e2260527189a07 /addons/web_editor/static | |
| parent | 5af12238781a147b56572d5b576f64a4e1473083 (diff) | |
[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
Diffstat (limited to 'addons/web_editor/static')
| -rw-r--r-- | addons/web_editor/static/tests/web_editor_tests.js | 16 |
1 files 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: '<form string="Partners">' + - '<field name="body" widget="html_frame" options="{\'editor_url\': \'/test\'}"/>' + + '<field name="body" widget="html_frame" options="{\'editor_url\': \'/logo\'}"/>' + '</form>', 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: '<form string="Partners">' + '<sheet>' + - '<field name="body" widget="html_frame" options="{\'editor_url\': \'/test\'}"/>' + + '<field name="body" widget="html_frame" options="{\'editor_url\': \'/logo\'}"/>' + '</sheet>' + '</form>', 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: '<form string="Partners">' + '<sheet>' + '<field name="display_name"/>' + - '<field name="body" widget="html_frame" options="{\'editor_url\': \'/test\'}"/>' + + '<field name="body" widget="html_frame" options="{\'editor_url\': \'/logo\'}"/>' + '</sheet>' + '</form>', 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: '<form string="Partners">' + '<sheet>' + '<field name="display_name"/>' + - '<field name="body" widget="html_frame" options="{\'editor_url\': \'/test\'}"/>' + + '<field name="body" widget="html_frame" options="{\'editor_url\': \'/logo\'}"/>' + '</sheet>' + '</form>', 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; |
