diff options
Diffstat (limited to 'addons/web/static/tests/fields/upgrade_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/upgrade_fields_tests.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/upgrade_fields_tests.js b/addons/web/static/tests/fields/upgrade_fields_tests.js index babc32b60a8..427ec7b54e3 100644 --- a/addons/web/static/tests/fields/upgrade_fields_tests.js +++ b/addons/web/static/tests/fields/upgrade_fields_tests.js @@ -39,6 +39,28 @@ QUnit.module('upgrade_fields', { form.destroy(); }); + QUnit.test('widget upgrade_boolean in a form view', function (assert) { + assert.expect(3); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '<form>' + + '<div class="o_field"><field name="bar" widget="upgrade_boolean"/></div>' + + '<div class="o_label"><label for="bar"/><div>Coucou</div></div>' + + '</form>', + }); + + assert.strictEqual(form.$('.o_field .label').length, 0, + "the upgrade label shouldn't be inside the field section"); + assert.strictEqual(form.$('.o_label .label').length, 1, + "the upgrade label should be inside the label section"); + assert.strictEqual(form.$('.o_label').text(), "Bar EnterpriseCoucou", + "the upgrade label should be inside the label section"); + form.destroy(); + }); + }); }); }); |
