@ordergroove/offers 2.45.5 → 2.45.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordergroove/offers",
3
- "version": "2.45.5",
3
+ "version": "2.45.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",
@@ -49,5 +49,5 @@
49
49
  "@ordergroove/offers-templates": "^0.9.8",
50
50
  "@types/lodash.memoize": "^4.1.9"
51
51
  },
52
- "gitHead": "882d256d0e2bcdc6592f9e789783565e633f7c21"
52
+ "gitHead": "60f759b8f2452b4569e6e5d0f6c8e06c96581d8e"
53
53
  }
@@ -97,7 +97,11 @@ describe('experiments', () => {
97
97
  }
98
98
  inputs.forEach(weights =>
99
99
  it(`should roll the dice ${weights}`, () => {
100
- expect(test(weights)).toEqual(weights);
100
+ const results = test(weights);
101
+ results.forEach((result, index) => {
102
+ // since this is random, we give it +-1 margin of error
103
+ expect(Math.abs(result - weights[index])).toBeLessThanOrEqual(1);
104
+ });
101
105
  })
102
106
  );
103
107
  });
package/src/make-api.js CHANGED
@@ -109,6 +109,7 @@ export default function makeApi(store) {
109
109
  delete window.og;
110
110
  } else {
111
111
  window.og.previewMode = true;
112
+ console.log('OG Offers preview mode enabled');
112
113
  }
113
114
  return this;
114
115
  },