@ordergroove/offers 2.45.6-alpha-PR-1241-2.6 → 2.46.0
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 +19 -0
- package/dist/bundle-report.html +5 -5
- package/dist/examples.js +5 -5
- package/dist/examples.js.map +2 -2
- package/dist/offers.js +2 -2
- package/dist/offers.js.map +2 -2
- package/package.json +3 -3
- package/src/components/Tooltip.js +1 -0
- package/src/components/__tests__/Tooltip.spec.js +1 -0
- package/src/core/__tests__/experiments.spec.js +5 -1
- package/src/make-api.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.46.0",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"throttle-debounce": "^2.1.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@ordergroove/offers-templates": "^0.
|
|
49
|
+
"@ordergroove/offers-templates": "^0.10.0",
|
|
50
50
|
"@types/lodash.memoize": "^4.1.9"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "29fe0f44f5d9dc13b9c8a150b894b5a99c31cd8d"
|
|
53
53
|
}
|
|
@@ -218,6 +218,7 @@ export class Tooltip extends LitElement {
|
|
|
218
218
|
async recalculatePosition() {
|
|
219
219
|
// wait for state changes to apply
|
|
220
220
|
await this.updateComplete;
|
|
221
|
+
if (!this.open) return;
|
|
221
222
|
const trigger = this.shadowRoot.querySelector('.trigger');
|
|
222
223
|
const triggerRect = trigger.getBoundingClientRect();
|
|
223
224
|
const content = this.shadowRoot.querySelector('.content');
|
|
@@ -97,7 +97,11 @@ describe('experiments', () => {
|
|
|
97
97
|
}
|
|
98
98
|
inputs.forEach(weights =>
|
|
99
99
|
it(`should roll the dice ${weights}`, () => {
|
|
100
|
-
|
|
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
|
});
|