From cf178a2f068acd4b4c4fc2cda00b6ef8f6dc79c0 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 4 Jan 2018 16:17:14 +0100 Subject: [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. --- addons/web/static/tests/helpers/test_utils.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/tests/helpers/test_utils.js') diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js index 260436ff152..468b25e5733 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -346,6 +346,7 @@ function addMockEnvironment(widget, params) { initialConfig.device = _.clone(config.device); if ('device' in params.config) { _.extend(config.device, params.config.device); + config.device.isMobile = config.device.size_class <= config.device.SIZES.XS; } if ('debug' in params.config) { config.debug = params.config.debug; -- cgit v1.2.3