diff options
| author | wan <wan@odoo.com> | 2020-09-04 14:00:50 +0000 |
|---|---|---|
| committer | wan <wan@odoo.com> | 2020-09-10 14:52:46 +0000 |
| commit | 01d25e87c358f0afbe76301c64db5ce21c59c806 (patch) | |
| tree | 097cb2fe555ab78080fa49367853ced2d2e6ef79 /addons/web/static/tests/fields | |
| parent | 1e4690a6b70f710c502a5b623f511cec94375169 (diff) | |
[IMP] web: add the raw value of selection fields
Task 2327599
It is used in the selector of a tour to know the type of a document.
Diffstat (limited to 'addons/web/static/tests/fields')
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 6 |
1 files changed, 5 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 56bb564880f..487e953003f 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -997,7 +997,7 @@ QUnit.module('relational_fields', { }); QUnit.test('widget selection, edition and on many2one field', async function (assert) { - assert.expect(19); + assert.expect(21); this.data.partner.onchanges = {product_id: function () {}}; this.data.partner.records[0].product_id = 37; @@ -1024,10 +1024,14 @@ QUnit.module('relational_fields', { assert.containsNone(form.$('.o_form_view'), 'select'); assert.strictEqual(form.$('.o_field_widget[name=product_id]').text(), 'xphone', "should have rendered the many2one field correctly"); + assert.strictEqual(form.$('.o_field_widget[name=product_id]').attr('raw-value'), '37', + "should have set the raw-value attr for many2one field correctly"); assert.strictEqual(form.$('.o_field_widget[name=trululu]').text(), '', "should have rendered the unset many2one field correctly"); assert.strictEqual(form.$('.o_field_widget[name=color]').text(), 'Red', "should have rendered the selection field correctly"); + assert.strictEqual(form.$('.o_field_widget[name=color]').attr('raw-value'), 'red', + "should have set the raw-value attr for selection field correctly"); await testUtils.form.clickEdit(form); |
