diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-06-17 13:20:35 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-06-17 13:20:35 +0200 |
| commit | 25e3f270625b1a7f239d34fab94444d0b676d52e (patch) | |
| tree | a83ee8f72c2aedbe6c28fc89b6de4a655d5d97e6 /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 382989c341935582f6ae47510796ecd8d9f6b710 (diff) | |
| parent | 48a9f5a6335cfe8b3d465584f0d2f98be2530966 (diff) | |
[MERGE] forward port branch saas-12.3 up to 48a9f5a6335
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -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); |
