[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@b29e17765f and odoo/design-themes@8b377af3a7 . closes odoo/odoo#125500 X-original-commit: 82074846c429dd6abad5734680ca3e7923668bb9 Signed-off-by: Romain Derie (rde) <rde@odoo.com> Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
@@ -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})`);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user