diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-28 15:01:11 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-28 15:01:11 +0200 |
| commit | 1512c1b22993ba66a2cfff36bb92b8babca4cc95 (patch) | |
| tree | 62fe209f48ffc5b7951b307fd7e327d17c8b1165 /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 63a4370afd3377de4308349283b981fac748e36c (diff) | |
| parent | 9f9a7fdd0d70c1edda94fc546916c9e3516477ad (diff) | |
[MERGE] forward port branch saas-18 up to 9f9a7fdd0d7
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 91029cf9cfc..f01f2d8b589 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1040,6 +1040,24 @@ QUnit.module('basic_fields', { form.destroy(); }); + QUnit.test('url widget takes text from proper attribute', function (assert) { + assert.expect(1); + + var form = createView({ + View: FormView, + model: 'partner', + data: this.data, + arch:'<form string="Partners">' + + '<field name="foo" widget="url" text="kebeclibre"/>' + + '</form>', + res_id: 1, + }); + + assert.strictEqual(form.$('a[name="foo"]').text(), 'kebeclibre', + "url text should come from the text attribute"); + form.destroy(); + }); + QUnit.test('char field in editable list view', function (assert) { assert.expect(10); @@ -2587,7 +2605,7 @@ QUnit.module('basic_fields', { }, }); - var $phoneLink = form.$('a.o_form_uri.o_field_widget.o_text_overflow'); + var $phoneLink = form.$('a.o_form_uri.o_field_widget'); assert.strictEqual($phoneLink.length, 1, "should have a anchor with correct classes"); assert.strictEqual($phoneLink.text(), 'y\u00ADop', @@ -2607,7 +2625,7 @@ QUnit.module('basic_fields', { // save form.$buttons.find('.o_form_button_save').click(); - $phoneLink = form.$('a.o_form_uri.o_field_widget.o_text_overflow'); + $phoneLink = form.$('a.o_form_uri.o_field_widget'); assert.strictEqual($phoneLink.text(), 'n\u00ADew', "new value should be displayed properly as text with the skype obfuscation"); assert.strictEqual($phoneLink.attr('href'), 'tel:new', @@ -2637,7 +2655,7 @@ QUnit.module('basic_fields', { assert.strictEqual(list.$('tbody td:not(.o_list_record_selector)').first().text(), 'y\u00ADop', "value should be displayed properly as text with the skype obfuscation"); - var $phoneLink = list.$('a.o_form_uri.o_field_widget.o_text_overflow'); + var $phoneLink = list.$('a.o_form_uri.o_field_widget'); assert.strictEqual($phoneLink.length, 5, "should have anchors with correct classes"); assert.strictEqual($phoneLink.first().attr('href'), 'tel:yop', @@ -2657,7 +2675,7 @@ QUnit.module('basic_fields', { assert.ok(!$cell.parent().hasClass('o_selected_row'), 'should not be in edit mode anymore'); assert.strictEqual(list.$('tbody td:not(.o_list_record_selector)').first().text(), 'n\u00ADew', "value should be properly updated"); - $phoneLink = list.$('a.o_form_uri.o_field_widget.o_text_overflow'); + $phoneLink = list.$('a.o_form_uri.o_field_widget'); assert.strictEqual($phoneLink.length, 5, "should still have anchors with correct classes"); assert.strictEqual($phoneLink.first().attr('href'), 'tel:new', @@ -2697,7 +2715,7 @@ QUnit.module('basic_fields', { }, }); - var $phone = form.$('span.o_field_widget.o_text_overflow:not(.o_form_uri)'); + var $phone = form.$('span.o_field_widget:not(.o_form_uri)'); assert.strictEqual($phone.length, 1, "should have a simple span rather than a link"); assert.strictEqual($phone.text(), 'yop', @@ -2715,7 +2733,7 @@ QUnit.module('basic_fields', { // save form.$buttons.find('.o_form_button_save').click(); - assert.strictEqual(form.$('span.o_field_widget.o_text_overflow:not(.o_form_uri)').text(), 'new', + assert.strictEqual(form.$('span.o_field_widget:not(.o_form_uri)').text(), 'new', "new value should be displayed properly as text without skype obfuscation"); form.destroy(); @@ -2750,7 +2768,7 @@ QUnit.module('basic_fields', { assert.strictEqual(list.$('tbody td:not(.o_list_record_selector)').first().text(), 'yop', "value should be displayed properly as text without skype obfuscation"); - assert.strictEqual(list.$('span.o_field_widget.o_text_overflow:not(.o_form_uri)').length, 5, + assert.strictEqual(list.$('span.o_field_widget:not(.o_form_uri)').length, 5, "should have spans with correct classes"); // Edit a line and check the result @@ -2767,7 +2785,7 @@ QUnit.module('basic_fields', { assert.ok(!$cell.parent().hasClass('o_selected_row'), 'should not be in edit mode anymore'); assert.strictEqual(list.$('tbody td:not(.o_list_record_selector)').first().text(), 'new', "value should be properly updated"); - assert.strictEqual(list.$('span.o_field_widget.o_text_overflow:not(.o_form_uri)').length, 5, + assert.strictEqual(list.$('span.o_field_widget:not(.o_form_uri)').length, 5, "should still have spans with correct classes"); list.destroy(); |
