@bluedot-innovation/models 8.3.5 → 8.3.6
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
CHANGED
|
@@ -81,6 +81,19 @@ testCase('Account', () => {
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
})
|
|
84
|
+
|
|
85
|
+
assertions('should throw an error when Account has invalid type', (done) => {
|
|
86
|
+
let Account = new AccountModel(account)
|
|
87
|
+
Account.type = "Invalid"
|
|
88
|
+
|
|
89
|
+
Account.validate((err, res) => {
|
|
90
|
+
assert.notExists(res)
|
|
91
|
+
assert.exists(err, 'err object should exist')
|
|
92
|
+
assert.isObject(err.errors)
|
|
93
|
+
assert.match(err.message, /`Invalid` is not a valid enum value for path `type`/)
|
|
94
|
+
done()
|
|
95
|
+
})
|
|
96
|
+
})
|
|
84
97
|
})
|
|
85
98
|
|
|
86
99
|
testCase('recursive invalid entry check', () => {
|
package/models/Account.js
CHANGED
|
@@ -32,7 +32,8 @@ let AccountSchema = new mongoose.Schema({
|
|
|
32
32
|
integrations: {
|
|
33
33
|
sfmc: {type: SfmcIntegration},
|
|
34
34
|
attentive: {type: AttentiveIntegration}
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
|
+
type: { type: String, default: 'Internal', enum: ['Production', 'POC', 'Prospect', 'Internal'] }
|
|
36
37
|
},
|
|
37
38
|
{collection: 'account'})
|
|
38
39
|
|
package/package.json
CHANGED