summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/basic_fields_tests.js
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2017-09-20 14:23:27 +0200
committerLucas Perais (lpe) <lpe@odoo.com>2017-09-26 09:37:16 +0200
commite64762e535504a82c5a55615b9a3e17dbf7ac562 (patch)
tree32340a98c0e8f17a0b250362ffee508509b95844 /addons/web/static/tests/fields/basic_fields_tests.js
parentb4824d78ebdbe3363286458f16175fe78069d6c9 (diff)
[FIX] web, google_drive: fixed display of field link
Before this commit, a field handled with a widget url was given its value (href) as its text, fully displaying the url. Moreover, the display was odd and did not match that of buttons After this commit, if the field contains a text attribute, we use is as the text of the link. The link also correctly displays and looks like a button (in a form view) Of course, a test for this new field widget feature is implemented closes #19587
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/basic_fields_tests.js18
1 files changed, 18 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 91029cf9cfc..8560354c760 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);