diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-12-07 10:57:08 +0100 |
|---|---|---|
| committer | Martin Geubelle <mge@odoo.com> | 2018-01-05 17:34:26 +0100 |
| commit | d4982394bc9cf2b330e7c87bd7b8d1cae74ffb5f (patch) | |
| tree | bb43286ca32919bad8bf1df736f96e8f67e59935 /addons/web/static/tests/fields | |
| parent | 73e2ba991c0e74654f3c2e2ae02485196d25fe1e (diff) | |
[FIX] web: speed resequence up in x2m
Resequencing a x2m is very slow because the view is reloaded after each
change instead of only once after all the changes.
Diffstat (limited to 'addons/web/static/tests/fields')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index 853c3bd69d6..3b9dcf7d684 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -5,6 +5,7 @@ var AbstractField = require('web.AbstractField'); var BasicModel = require('web.BasicModel'); var concurrency = require('web.concurrency'); var FormView = require('web.FormView'); +var ListRenderer = require('web.ListRenderer'); var ListView = require('web.ListView'); var relationalFields = require('web.relational_fields'); var StandaloneFieldManagerMixin = require('web.StandaloneFieldManagerMixin'); @@ -2271,7 +2272,15 @@ QUnit.module('relational_fields', { }); QUnit.test('embedded one2many with handle widget', function (assert) { - assert.expect(8); + assert.expect(10); + + var nbConfirmChange = 0; + testUtils.patch(ListRenderer, { + confirmChange: function () { + nbConfirmChange++; + return this._super.apply(this, arguments); + }, + }); this.data.partner.records[0].turtles = [1, 2, 3]; @@ -2304,8 +2313,10 @@ QUnit.module('relational_fields', { "should have the 3 rows in the correct order"); form.$buttons.find('.o_form_button_edit').click(); + assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "yopblipkawa", "should still have the 3 rows in the correct order"); + assert.strictEqual(nbConfirmChange, 0, "should not have confirmed any change yet"); // Drag and drop the second line in first position testUtils.dragAndDrop( @@ -2314,6 +2325,7 @@ QUnit.module('relational_fields', { {position: 'top'} ); + assert.strictEqual(nbConfirmChange, 1, "should have confirmed changes only once"); assert.verifySteps(["0", "1"], "sequences values should be incremental starting from the previous minimum one"); @@ -2333,6 +2345,8 @@ QUnit.module('relational_fields', { assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "blipyopkawa", "should still have the 3 rows in the new order"); + testUtils.unpatch(ListRenderer); + form.destroy(); }); |
