diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-06-18 10:24:25 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-18 10:24:25 +0200 |
| commit | 9035fb8a2a4ddfae2951ed1f540060896924bb44 (patch) | |
| tree | 024ce185effd5b1cb59463d2a187a9fa4db35472 /addons/web/static/tests/fields | |
| parent | 0fc33c37c3cea3cadf69c2352f49c88b295bd63f (diff) | |
| parent | 618ea1ab675d6454280deac7d6f853b2556e5be1 (diff) | |
[MERGE] forward port branch saas-12.4 up to 618ea1ab675
Diffstat (limited to 'addons/web/static/tests/fields')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 30 |
1 files changed, 30 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 5c399547458..4e5deb56780 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1998,6 +1998,36 @@ QUnit.module('basic_fields', { list.destroy(); }); + QUnit.test("binary fields input value is empty whean clearing after uploading", async function (assert) { + assert.expect(2); + + var form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '<form string="Partners">' + + '<field name="document" filename="foo"/>' + + '<field name="foo"/>' + + '</form>', + res_id: 1, + }); + + await testUtils.form.clickEdit(form); + + // // We need to convert the input type since we can't programmatically set the value of a file input + form.$('.o_input_file').attr('type', 'text').val('coucou.txt'); + + assert.strictEqual(form.$('.o_input_file').val(), 'coucou.txt', + "input value should be changed to \"coucou.txt\""); + + await testUtils.dom.click(form.$('.o_field_binary_file > .o_clear_file_button')); + + assert.strictEqual(form.$('.o_input_file').val(), '', + "input value should be empty"); + + form.destroy(); + }); + QUnit.test('field text in editable list view', async function (assert) { assert.expect(1); |
