diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-19 11:06:46 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-19 11:06:46 +0200 |
| commit | 2a343d7c9c4b07bb6cf4c7c4197bb795a3d17f4b (patch) | |
| tree | 6b16c1bee8b6feb9ad3ac34e6a310d2c7e6264ba /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 97138a1eaeca76ebf297490604268dadbfa43f97 (diff) | |
| parent | c3a48da767b333d21ceff2cb829ffba102d6ff3d (diff) | |
[MERGE] forward port branch saas-16 up to c3a48da767b
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index b63bd27cba7..01c67fbb877 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -3813,6 +3813,46 @@ QUnit.module('basic_fields', { form.destroy(); }); + + QUnit.test('basic domain field: show the selection', function (assert) { + assert.expect(2); + + this.data.partner.records[0].foo = "[]"; + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: + '<form>' + + '<sheet>' + + '<group>' + + '<field name="foo" widget="domain" options="{\'model\': \'partner_type\'}"/>' + + '</group>' + + '</sheet>' + + '</form>', + archs: { + 'partner_type,false,list': '<tree><field name="display_name"/></tree>', + 'partner_type,false,search': '<search><field name="name" string="Name"/></search>', + }, + res_id: 1, + }); + + assert.equal(form.$(".o_domain_show_selection_button").text().trim().substr(0, 2), "2 ", + "selection should contain 2 records"); + + // open the selection + form.$(".o_domain_show_selection_button").click(); + assert.strictEqual($('.modal .o_list_view .o_data_row').length, 2, + "should have open a list view with 2 records in a dialog"); + + // click on a record -> should not open the record + // we don't actually check that it doesn't open the record because even + // if it tries to, it will crash as we don't define an arch in this test + $('.modal .o_list_view .o_data_row:first .o_data_cell').click(); + + form.destroy(); + }); }); }); }); |
