Skip to content

Commit 76dfe5f

Browse files
committed
Fix static test failure
1 parent a2f6702 commit 76dfe5f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/code/Magento/Checkout/view/frontend/web/js/cart/ensure-subtotal-sync.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ define([
2222
if (!text) {
2323
return NaN;
2424
}
25+
2526
// Remove non-numeric except . , - then normalize
2627
let cleaned = ('' + text).replace(/[^0-9,.-]/g, '');
2728

@@ -32,6 +33,7 @@ define([
3233
// European format: swap , to .
3334
cleaned = cleaned.replace(/,/g, '.');
3435
}
36+
3537
const n = parseFloat(cleaned);
3638

3739
return isNaN(n) ? NaN : Math.round(n * 100) / 100;
@@ -49,6 +51,7 @@ define([
4951
sum += val;
5052
}
5153
});
54+
5255
return Math.round(sum * 100) / 100;
5356
}
5457

@@ -65,10 +68,12 @@ define([
6568
if (clicked) {
6669
return;
6770
}
71+
6872
const central = getCentralSubtotal(), summary = getSummarySubtotal();
69-
73+
7074
if (!isNaN(central) && !isNaN(summary) && central !== summary) {
7175
const $updateBtn = $root.find('.cart.main.actions button.action.update');
76+
7277
if ($updateBtn.length) {
7378
clicked = true;
7479
$updateBtn.trigger('click');

0 commit comments

Comments
 (0)