@bluedot-innovation/models 7.5.1 → 7.5.3
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/.gitlab-ci.yml +1 -1
- package/CHANGELOG.md +6 -0
- package/__tests__/user/user.spec.js +26 -0
- package/models/TestInstance.js +2 -0
- package/models/User.js +1 -1
- package/package.json +1 -1
package/.gitlab-ci.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -40,6 +40,19 @@ describe('User', () => {
|
|
|
40
40
|
done()
|
|
41
41
|
})
|
|
42
42
|
})
|
|
43
|
+
|
|
44
|
+
it('should set mfaRequired to false if not present', (done) => {
|
|
45
|
+
user = JSON.parse(JSON.stringify(user))
|
|
46
|
+
delete user.mfaRequired
|
|
47
|
+
|
|
48
|
+
const User = new UserModel(user)
|
|
49
|
+
assert(User.mfaRequired === false)
|
|
50
|
+
User.validate((err, res) => {
|
|
51
|
+
assert.notExists(res)
|
|
52
|
+
assert(err === null, 'err equals null')
|
|
53
|
+
done()
|
|
54
|
+
})
|
|
55
|
+
})
|
|
43
56
|
})
|
|
44
57
|
|
|
45
58
|
describe('Invalid User', () => {
|
|
@@ -60,6 +73,19 @@ describe('User', () => {
|
|
|
60
73
|
})
|
|
61
74
|
})
|
|
62
75
|
})
|
|
76
|
+
|
|
77
|
+
it('should not allow mfaRequired to be set to null', (done) => {
|
|
78
|
+
user = JSON.parse(JSON.stringify(user))
|
|
79
|
+
user.mfaRequired = null
|
|
80
|
+
const User = new UserModel(user)
|
|
81
|
+
User.validate((err, res) => {
|
|
82
|
+
assert.notExists(res)
|
|
83
|
+
assert.exists(err, 'err object should exist')
|
|
84
|
+
assert.isObject(err.errors)
|
|
85
|
+
assert.nestedProperty(err, `errors.mfaRequired`, `error should have a mfaRequired property`)
|
|
86
|
+
done()
|
|
87
|
+
})
|
|
88
|
+
})
|
|
63
89
|
})
|
|
64
90
|
|
|
65
91
|
describe('recursive invalid entry check', () => {
|
package/models/TestInstance.js
CHANGED
|
@@ -28,6 +28,8 @@ let TestInstanceSchema = new mongoose.Schema(
|
|
|
28
28
|
isValid: {type: Boolean, default: true},
|
|
29
29
|
comments: String,
|
|
30
30
|
isProduction: Boolean,
|
|
31
|
+
enableBackgroundLocationIndicator: {type: Boolean, default: false},
|
|
32
|
+
enableForegroundService: {type: Boolean, default: true},
|
|
31
33
|
sdkVersion: String,
|
|
32
34
|
sdkBuildNumber: String,
|
|
33
35
|
platform: String,
|
package/models/User.js
CHANGED
package/package.json
CHANGED