cozy-client 40.4.0 → 40.5.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.
@@ -2695,7 +2695,7 @@ var CozyClient = /*#__PURE__*/function () {
2695
2695
  CozyClient.hooks = CozyClient.hooks || {};
2696
2696
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2697
2697
 
2698
- CozyClient.version = "40.4.0";
2698
+ CozyClient.version = "40.5.0";
2699
2699
 
2700
2700
  _microee.default.mixin(CozyClient);
2701
2701
 
@@ -21,7 +21,7 @@
21
21
  "items": {
22
22
  "accommodation_proof": "Proof of accommodation |||| Proof of accommodations",
23
23
  "appliance_invoice": "Appliance invoice |||| Appliance invoices",
24
- "bank_details": "IBAN",
24
+ "bank_details": "Bank detail |||| Bank details",
25
25
  "bank_statement": "Bank statement |||| Bank statements",
26
26
  "birth_certificate": "Birth certificate |||| Birth certificates",
27
27
  "building_permit": "Building permit |||| Building permits",
@@ -21,7 +21,7 @@
21
21
  "items": {
22
22
  "accommodation_proof": "Attestation d'hébergement |||| Attestations d'hébergement",
23
23
  "appliance_invoice": "Facture d'électroménager |||| Factures d'électroménager",
24
- "bank_details": "IBAN",
24
+ "bank_details": "RIB",
25
25
  "bank_statement": "Relevé de compte |||| Relevés de compte",
26
26
  "birth_certificate": "Certificat de naissance |||| Certificats de naissance",
27
27
  "building_permit": "Permis de construire",
@@ -9,9 +9,9 @@ describe('getBoundT', () => {
9
9
  expect(res).toBe('ID card')
10
10
  })
11
11
  it('should return translation if it has no pluralization pipes', () => {
12
- const res = t('Scan.items.bank_details')
12
+ const res = t('Scan.items.health')
13
13
 
14
- expect(res).toBe('IBAN')
14
+ expect(res).toBe('Health')
15
15
  })
16
16
  it('should return "default value" option', () => {
17
17
  const res = t('Scan.items.unknown_key', { _: 'default value' })
@@ -130,7 +130,7 @@ var hasPasswordDefinedAttribute = /*#__PURE__*/function () {
130
130
  case 3:
131
131
  _yield$client$fetchQu = _context.sent;
132
132
  password_defined = _yield$client$fetchQu.data.attributes.password_defined;
133
- return _context.abrupt("return", password_defined);
133
+ return _context.abrupt("return", Boolean(password_defined));
134
134
 
135
135
  case 8:
136
136
  _context.prev = 8;
@@ -147,4 +147,34 @@ describe('instance', () => {
147
147
  })
148
148
  })
149
149
  })
150
+
151
+ describe('hasPasswordDefinedAttribute', () => {
152
+ const setup = async (data = {}) => {
153
+ const client = {
154
+ fetchQueryAndGetFromState: jest
155
+ .fn()
156
+ .mockImplementation(() => Promise.resolve({ data }))
157
+ }
158
+ return await instance.hasPasswordDefinedAttribute(client)
159
+ }
160
+ it('should return false if attribute password_defined does not exist', async () => {
161
+ const res = await setup()
162
+ expect(res).toBe(false)
163
+ })
164
+
165
+ it('should return false if attribute password_defined is undefined', async () => {
166
+ const res = await setup({ attributes: { password_defined: undefined } })
167
+ expect(res).toBe(false)
168
+ })
169
+
170
+ it('should return false if attribute password_defined is false', async () => {
171
+ const res = await setup({ attributes: { password_defined: false } })
172
+ expect(res).toBe(false)
173
+ })
174
+
175
+ it('should return true if attribute password_defined is true', async () => {
176
+ const res = await setup({ attributes: { password_defined: true } })
177
+ expect(res).toBe(true)
178
+ })
179
+ })
150
180
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "40.4.0",
3
+ "version": "40.5.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "959a3be0c79a3423720b8ddeb13c101bfd4a3ffc"
76
+ "gitHead": "c05e32361f5bb6f3303d591a454b47a03bbb8217"
77
77
  }