From d64a23ea22065ee711342c1a734e899cbf44b3d2 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Fri, 16 Jun 2023 10:17:34 +0000 Subject: [PATCH] [FIX] website: CSS properties value comparison Due to a change between Chrome 101 and 114, the CSS Custom Property containing custom string are now always serialized using the type of quotes used in their declaration (ie. single quotes will be kept ; double quotes also) which wasn't the case in previous versions of Chrome (and still not the case in WebKitGTK 2.40.0 at least). This doesn't impact the value itself but only comparison between the computed value and an arbitrary one (like we do in the design-themes test). This commit fixes it by removing the single/double quotes in the `assertCssVariable` test helper. The impacted precondition was introduced in odoo/odoo@b29e17765f4e912b2dd472493b5be500b3a32c87 and odoo/design-themes@8b377af3a71b875dfc452a14206a9a1679371000 . closes odoo/odoo#125500 X-original-commit: 82074846c429dd6abad5734680ca3e7923668bb9 Signed-off-by: Romain Derie (rde) Signed-off-by: Christophe Monniez (moc) --- addons/website/static/src/js/tours/tour_utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/js/tours/tour_utils.js b/addons/website/static/src/js/tours/tour_utils.js index b21ed6de4aa..2db178ce20b 100644 --- a/addons/website/static/src/js/tours/tour_utils.js +++ b/addons/website/static/src/js/tours/tour_utils.js @@ -21,7 +21,7 @@ function assertCssVariable(variableName, variableValue, trigger = 'iframe body') auto: true, run: function () { const styleValue = getComputedStyle(this.$anchor[0]).getPropertyValue(variableName); - if ((styleValue && styleValue.trim()) !== variableValue.trim()) { + if ((styleValue && styleValue.trim().replace(/["']/g, '')) !== variableValue.trim().replace(/["']/g, '')) { throw new Error(`Failed precondition: ${variableName}=${styleValue} (should be ${variableValue})`); } },