Skip to content

Commit c2004dd

Browse files
committed
MC-29938: Price of a Bundle Product is calculated incorrectly at the product page
- fix CR comments
1 parent 7bc1171 commit c2004dd

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

dev/tests/js/jasmine/tests/app/code/Magento/Bundle/base/js/price-bundle.test.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ define([
3333
htmlContainer.priceBundle();
3434

3535
expect($.mage.priceBundle.prototype._updatePriceBox).toEqual(jasmine.any(Function));
36-
expect($.mage.priceBundle.prototype._updatePriceBox).toHaveBeenCalled();
3736
expect($.mage.priceBundle.prototype._updatePriceBox).toHaveBeenCalledTimes(1);
3837
});
3938

@@ -45,6 +44,24 @@ define([
4544
expect($.mage.priceBundle.prototype._updatePriceBox).toHaveBeenCalledTimes(2);
4645
});
4746

47+
it('Check _applyOptionNodeFix method doesn\'t call after priceBox initialization.', function () {
48+
var optionConfig = {
49+
optionConfig: {
50+
prices: {}
51+
}
52+
},
53+
priceConfig = {
54+
priceConfig: 10
55+
};
56+
57+
spyOn($.mage.priceBundle.prototype, '_applyOptionNodeFix').and.callThrough();
58+
htmlContainer.priceBundle(optionConfig);
59+
$('.price-box', htmlContainer).priceBox(priceConfig);
60+
$('.price-box', htmlContainer).trigger('price-box-initialized');
61+
expect($.mage.priceBundle.prototype._applyOptionNodeFix).toEqual(jasmine.any(Function));
62+
expect($.mage.priceBundle.prototype._applyOptionNodeFix).toHaveBeenCalledTimes(2);
63+
});
64+
4865
it('Check _updatePriceBox method call before priceBox was initialized.', function () {
4966
spyOn($.mage.priceBundle.prototype, '_updatePriceBox').and.callThrough();
5067
$('.price-box', htmlContainer).priceBox();

0 commit comments

Comments
 (0)