summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/basic_fields_tests.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-04-20 11:08:50 +0200
committerAaron Bohy <aab@odoo.com>2017-04-20 13:12:50 +0200
commit6a5f18f9709674ffa1a8557afe16448f38c29487 (patch)
tree288607f0b3c2276fb031d7d78ac092d01dd7ed18 /addons/web/static/tests/fields/basic_fields_tests.js
parentef3200f9409aab0a247e234154f18e77087ece05 (diff)
[FIX] web: AceEditor tests: don't try to remove libs
... to clean up once the test is finished, because it doesn't work. The previous solution to clean up only deleted ace and require from window, but doing this didn't force a reload of the libs for a potential second test using ace (because the scripts were still in the page). Trying to remove the scripts from the page doesn't work either because the loadJS function uses an internal cache to prevent from loading twice the same lib. So if we want to have more than one test on ace, we can't clean up the libs.
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/basic_fields_tests.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js
index 1dd84ce3dd4..a9787482153 100644
--- a/addons/web/static/tests/fields/basic_fields_tests.js
+++ b/addons/web/static/tests/fields/basic_fields_tests.js
@@ -894,10 +894,9 @@ QUnit.module('basic_fields', {
QUnit.module('AceEditor');
QUnit.test('ace widget on text fields works', function (assert) {
- assert.expect(3);
+ assert.expect(2);
var done = assert.async();
- assert.notOk('ace' in window, "the ace library should not be loaded");
this.data.partner.fields.foo.type = 'text';
testUtils.createAsyncView({
View: FormView,
@@ -908,10 +907,8 @@ QUnit.module('basic_fields', {
'</form>',
res_id: 1,
}).then(function (form) {
- assert.ok('ace' in window, "the ace library should now be loaded");
+ assert.ok('ace' in window, "the ace library should be loaded");
assert.ok(form.$('div.ace_content').length, "should have rendered something with ace editor");
- delete window.require;
- delete window.ace;
form.destroy();
done();
});