cozy-client 40.4.0 → 40.4.1
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/dist/CozyClient.js
CHANGED
|
@@ -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.
|
|
2698
|
+
CozyClient.version = "40.4.1";
|
|
2699
2699
|
|
|
2700
2700
|
_microee.default.mixin(CozyClient);
|
|
2701
2701
|
|
package/dist/models/instance.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "40.4.1",
|
|
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": "
|
|
76
|
+
"gitHead": "09df56daa818e677b7aec6c1d74ac6dd2a5d14b0"
|
|
77
77
|
}
|