@ordergroove/offers 2.30.6-alpha-PR-719-2.5 → 2.30.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.30.6](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.30.5...@ordergroove/offers@2.30.6) (2023-02-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * rounding issue on prepaid when calculating subscriptionPrice ([4710c5e](https://github.com/ordergroove/plush-toys/commit/4710c5e3c8ec0571d0d85870c01c6858f9baf568))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.30.5](https://github.com/ordergroove/plush-toys/compare/@ordergroove/offers@2.30.4...@ordergroove/offers@2.30.5) (2023-02-17)
7
18
 
8
19
  **Note:** Version bump only for package @ordergroove/offers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordergroove/offers",
3
- "version": "2.30.6-alpha-PR-719-2.5+da65ad5e",
3
+ "version": "2.30.6",
4
4
  "description": "offer state component",
5
5
  "author": "Eugenio Lattanzio <eugenio63@gmail.com>",
6
6
  "homepage": "https://github.com/ordergroove/plush-toys#readme",
@@ -47,5 +47,5 @@
47
47
  "devDependencies": {
48
48
  "@ordergroove/offers-templates": "^0.5.3"
49
49
  },
50
- "gitHead": "da65ad5e152472bd2f558b35c68725272d08959a"
50
+ "gitHead": "1845a87c8a39b7a1b1fc79c62db1d9aa37decc72"
51
51
  }
@@ -371,7 +371,7 @@ describe('Shopify productPlan Reducer', () => {
371
371
  expect(productPlanCreated).toEqual(expectedProductPlan);
372
372
  });
373
373
 
374
- it('should create prepaid product plan solving rounding issue', () => {
374
+ it('should create prepaid product plan that rounds subscriptionPrice to nearest decimal', () => {
375
375
  const allocation = {
376
376
  price_adjustments: [
377
377
  {
@@ -414,21 +414,11 @@ describe('Shopify productPlan Reducer', () => {
414
414
  }
415
415
  ];
416
416
 
417
- const expectedProductPlan = {
418
- frequency: '688412983572',
419
- regularPrice: '$19.99',
420
- // There is to be an issue when not rounding where subscriptionPrice was calculated as $1599.3333333333333.35
421
- subscriptionPrice: '$15.99',
422
- discountRate: '20%',
423
- prepaidShipments: 3,
424
- regularPrepaidPrice: '$47.98',
425
- prepaidSavingsPerShipment: '$4.00',
426
- prepaidSavingsTotal: '$11.99'
427
- };
417
+ const expectedsubscriptionPrice = '$15.99';
428
418
 
429
419
  const productPlanCreated = mapSellingPlanToDiscount(allocation, sellingPlans);
430
420
 
431
- expect(productPlanCreated).toEqual(expectedProductPlan);
421
+ expect(productPlanCreated.subscriptionPrice).toEqual(expectedsubscriptionPrice);
432
422
  });
433
423
 
434
424
  it('should create prepaid product plan with extra discount percentage', () => {