summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/relational_fields_tests.js
diff options
context:
space:
mode:
authorAdrian Torres <atorresj@hotmail.be>2017-07-12 09:45:46 +0200
committerGitHub <noreply@github.com>2017-07-12 09:45:46 +0200
commited2a77e50e94d957caca6dea309d84c55908cf93 (patch)
tree1e88948cf6d6b38357bbc15f0361ce98e9b7fd76 /addons/web/static/tests/fields/relational_fields_tests.js
parent8881e61ec8512e504fcf798519745d73b68b5656 (diff)
[FIX] web: Fix FieldRadio's o_horizontal/vertical (#18163)
Diffstat (limited to 'addons/web/static/tests/fields/relational_fields_tests.js')
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js34
1 files changed, 30 insertions, 4 deletions
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index d4d3a6307f9..171b3e1f787 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -30,6 +30,7 @@ QUnit.module('relational_fields', {
type: "selection",
selection: [['red', "Red"], ['black', "Black"]],
default: 'red',
+ string: "Color",
},
date: {string: "Some Date", type: "date"},
datetime: {string: "Datetime Field", type: 'datetime'},
@@ -1472,11 +1473,11 @@ QUnit.module('relational_fields', {
}, true);
assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "My little Foo Valueblipyop",
- "should have the 3 rows in the correct order")
+ "should have the 3 rows in the correct order");
form.$buttons.find('.o_form_button_edit').click();
assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "My little Foo Valueblipyop",
- "should still have the 3 rows in the correct order")
+ "should still have the 3 rows in the correct order");
// Drag and drop the fourth line in second position
testUtils.dragAndDrop(
@@ -1489,11 +1490,11 @@ QUnit.module('relational_fields', {
"sequences values should be incremental starting from the previous minimum one");
assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "blipMy little Foo Valueyop",
- "should have the 3 rows in the new order")
+ "should have the 3 rows in the new order");
form.$buttons.find('.o_form_button_save').click();
assert.strictEqual(form.$('td.o_data_cell:not(.o_handle_cell)').text(), "blipMy little Foo Valueyop",
- "should still have the 3 rows in the new order")
+ "should still have the 3 rows in the new order");
form.destroy();
});
@@ -6412,6 +6413,31 @@ QUnit.module('relational_fields', {
form.destroy();
});
+ QUnit.test('fieldradio widget has o_horizontal or o_vertical class', function (assert) {
+ assert.expect(2);
+
+ this.data.partner.fields.color2 = this.data.partner.fields.color;
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: '<form>' +
+ '<group>' +
+ '<field name="color" widget="radio"/>' +
+ '<field name="color2" widget="radio" options="{\'horizontal\': True}"/>' +
+ '</group>' +
+ '</form>',
+ });
+
+ var btn1 = form.$('div.o_field_radio.o_vertical');
+ var btn2 = form.$('div.o_field_radio.o_horizontal');
+
+ assert.strictEqual(btn1.length, 1, "should have o_vertical class");
+ assert.strictEqual(btn2.length, 1, "should have o_horizontal class");
+ form.destroy();
+ });
+
QUnit.test('fieldradio widget with numerical keys encoded as strings', function (assert) {
assert.expect(5);