summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-01-04 16:17:14 +0100
committerAaron Bohy <aab@odoo.com>2018-01-26 19:26:03 +0100
commitcf178a2f068acd4b4c4fc2cda00b6ef8f6dc79c0 (patch)
tree8cc09ab6d4d81619654c008058f5b28874eae150 /addons/web/static/tests/fields
parentcb339842d4d8b19f3870127c00a6868af2e95004 (diff)
[IMP] web,*: config: add XXS size to config.device
In Less, the size_class XXS is defined and used in media queries. This rev. adds it in JS for sake of consistency. Code in addons comparing the size_class needed to be adapted due to the new XXS size_class. Moreover, we now use the helper 'config.device.isMobile' everywhere we should, instead of manually comparing the size_class. Finally, we changed the way the config.device has to be specified in the test environment. From now on, only the size_class should be set, and the isMobile flag is computed automatically.
Diffstat (limited to 'addons/web/static/tests/fields')
-rw-r--r--addons/web/static/tests/fields/basic_fields_tests.js26
1 files changed, 11 insertions, 15 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js
index 4fd9d6ee84e..44f00d1d7f9 100644
--- a/addons/web/static/tests/fields/basic_fields_tests.js
+++ b/addons/web/static/tests/fields/basic_fields_tests.js
@@ -3,6 +3,7 @@ odoo.define('web.basic_fields_tests', function (require) {
var basicFields = require('web.basic_fields');
var concurrency = require('web.concurrency');
+var config = require('web.config');
var core = require('web.core');
var FormView = require('web.FormView');
var KanbanView = require('web.KanbanView');
@@ -2987,9 +2988,8 @@ QUnit.module('basic_fields', {
res_id: 1,
config: {
device: {
- size_class: 0, // Screen XS
- SIZES: { XS: 0, SM: 1, MD: 2, LG: 3 },
- }
+ size_class: config.device.SIZES.XS,
+ },
},
});
@@ -3032,9 +3032,8 @@ QUnit.module('basic_fields', {
arch: '<tree editable="bottom"><field name="foo" widget="phone"/></tree>',
config: {
device: {
- size_class: 0, // Screen XS
- SIZES: { XS: 0, SM: 1, MD: 2, LG: 3 },
- }
+ size_class: config.device.SIZES.XS,
+ },
},
});
@@ -3097,9 +3096,8 @@ QUnit.module('basic_fields', {
res_id: 1,
config: {
device: {
- size_class: 1, // Screen SM
- SIZES: { XS: 0, SM: 1, MD: 2, LG: 3 },
- }
+ size_class: config.device.SIZES.SM,
+ },
},
});
@@ -3145,9 +3143,8 @@ QUnit.module('basic_fields', {
arch: '<tree editable="bottom"><field name="foo" widget="phone"/></tree>',
config: {
device: {
- size_class: 1, // Screen SM
- SIZES: { XS: 0, SM: 1, MD: 2, LG: 3 },
- }
+ size_class: config.device.SIZES.SM,
+ },
},
});
@@ -3199,9 +3196,8 @@ QUnit.module('basic_fields', {
},
config: {
device: {
- size_class: 0,
- SIZES: { XS: 0, SM: 1, MD: 2, LG: 3 },
- }
+ size_class: config.device.SIZES.XS,
+ },
},
});