cozy-client 60.21.1 → 60.21.2

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.
@@ -3126,7 +3126,7 @@ var CozyClient = /*#__PURE__*/function () {
3126
3126
  CozyClient.hooks = CozyClient.hooks || {};
3127
3127
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
3128
3128
 
3129
- CozyClient.version = "60.21.1";
3129
+ CozyClient.version = "60.21.2";
3130
3130
 
3131
3131
  _microee.default.mixin(CozyClient);
3132
3132
 
@@ -46,7 +46,7 @@ exports.arePremiumLinksEnabled = arePremiumLinksEnabled;
46
46
 
47
47
  var isFreemiumUser = function isFreemiumUser(instanceInfo) {
48
48
  var quota = (0, _get.default)(instanceInfo, 'diskUsage.data.quota', false);
49
- return parseInt(quota) <= PREMIUM_QUOTA;
49
+ return parseInt(quota) < PREMIUM_QUOTA;
50
50
  };
51
51
 
52
52
  exports.isFreemiumUser = isFreemiumUser;
@@ -49,6 +49,22 @@ const hadAnOfferInstance = {
49
49
  }
50
50
  }
51
51
  }
52
+
53
+ const freemiumInstance = {
54
+ diskUsage: {
55
+ data: {
56
+ quota: '1000'
57
+ }
58
+ }
59
+ }
60
+
61
+ const nonFreemiumInstance = {
62
+ diskUsage: {
63
+ data: {
64
+ quota: '50000000000'
65
+ }
66
+ }
67
+ }
52
68
  describe('instance', () => {
53
69
  it('should test if self hosted or not', () => {
54
70
  expect(instance.isSelfHosted(noSelfHostedInstance)).toBe(false)
@@ -69,7 +85,10 @@ describe('instance', () => {
69
85
  expect(instance.isFreemiumUser(noSelfHostedInstance)).toBe(true)
70
86
  expect(instance.isFreemiumUser(selftHostedInstance)).toBe(false)
71
87
  })
72
-
88
+ it('should correctly identify freemium vs non-freemium based on quota boundary', () => {
89
+ expect(instance.isFreemiumUser(freemiumInstance)).toBe(true)
90
+ expect(instance.isFreemiumUser(nonFreemiumInstance)).toBe(false)
91
+ })
73
92
  it('should tell us that this instance is concerned by our offers', () => {
74
93
  expect(instance.shouldDisplayOffers(noSelfHostedInstance)).toBe(true)
75
94
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "60.21.1",
3
+ "version": "60.21.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -74,5 +74,5 @@
74
74
  "react-native-ios11-devicecheck": "^0.0.3"
75
75
  },
76
76
  "sideEffects": false,
77
- "gitHead": "fde12fe912846e9e6c357330327de76022a62c88"
77
+ "gitHead": "ea2ffd13a2f79cf84efb9833c3aa93bfe3d53dc7"
78
78
  }